Back to Cosmos

Problem Link:

code/online_challenges/src/codechef/NUMGAME2/README.md

latest484 B
Original Source

Problem Link:

NUMGAME2

Description

Alice and Bob play the following game.They choose a number N to play with.The runs are as follows :

1.Bob plays first and the two players alternate.

2.In his/her turn ,a player can subtract from N any prime number(including 1) less than N.The number thus obtained is the new N.

3.The person who cannot make a move in his/her turn loses the game.

Assuming both play optimally,who wins the game ?