Company: Ola
Difficulty: medium
Pass The Ball Problem Description A group of N players, numbered 1 to N , are playing a game. Player P holds the ball at the beginning of the game. On every move, the player holding the ball must pass it to another player. A player K1 can pass the ball to a player K2 only if K1 divides K2 or K2 divides K1 . A maximum of X moves are allowed. A game is considered complete if the ball ends up with the player who started it, player P . A way to complete the game is the sequence of players who hold the ball, P -> a1 -> a2 -> ... -> ak , where ak = P , 1 <= k <= X , and every pass in it is allowed. Two ways are different when their sequences differ. The ball may come back to player P before the last move and then be passed on again, and any player may hold the ball any number of times. Find the number of possible ways to complete the game. Function Description Complete the function passTheBall in the editor below. passTheBall has the following parameters: int N : the number