codeforces Epic Game 題解
阿新 • • 發佈:2019-02-08
Simon and Antisimon play a game. Initially each player receives one fixed positive integer that doesn't change throughout the game. Simon receives numberaand Antisimon receives numberb. They also have a heap ofnstones. The players take turns to make a move and Simon starts. During a move a player should take from the heap the number of stones equal to the greatest common divisor of the fixed number he has received and the number of stones left in the heap. A player loses when he cannot take the required number of stones (i. e. the heap hasstrictly
Your task is to determine by the givena,bandnwho wins the game.