SP18183 DRUNK - Drunk Game

Description

Alice and Bob were getting bored and decided to play a game. The game involves a pile of coins. Both players take turns in picking a certain number of coins from the pile. Initially, the pile contains **N** coins. Alice makes the first move. The player who is unable to pick up any coins in his/her turn loses the game. Some of the details of the game are: 1. In each turn a player can only decide on picking up **1, 4, 9, 16** coins from the pile. 2. As both the players are drunk and not in complete control of their actions, even if they decide on picking up some coins, they might end up picking something else completely. So, if a person decides on picking up **X** coins from the pile, he/she might end up with **(X - 1), X or (X + 1)** coins with the relative probability of **C1: C2: C3** 3. In each turn a player has to eventually pick up at least **1** coin. Note that a player cannot decide on picking up **X** coins from the pile if the pile contains less than **X** coins at the time. Also, if a player decided on picking up **X** coins and it happens that picking up **(X + 1)** is not valid (This might happen if there are only **X** coins in the pile), then the relative probability distribution for the valid moves will be **C1: C2**. Similarly, if picking up **(X - 1)** coins is not valid, then the relative probability distribution for the valid moves will be **C2: C3**. As both of them are not in their right minds, they sometimes want to win and sometimes want to lose. But Bob still wonders what is his probability of winning/losing the game (depending on what he wants for a particular game). Help him find out his probability!

Input Format

N/A

Output Format

N/A