Two players A and B are playing a game. The game is as follows: the player having the turn can multiply the money with a particular number between 2 to 9 and pass the money to other player. For example initially if A is having 1 rupee with him , therefore he can multiply the money by any number from 2 to 9 and pass it to B.Now B can do the same thing and pass it to A.
So you are given a particular number n. The player whose multiplication results in amount >= n gets all of the money.
You are also given the player name who must win this game (suppose x) , you have to tell which player must have initial 1 rupee so that it can be guaranteed that x will win. (It is given that both players play optimally i.e. both player plays the best move for him to win).
EXAMPLE: If n=2 and winner is A.
A must have 1 ruppee initially So here answer is A.