{"problem":{"name":"AB Game","description":{"content":"The following game is called Game $n$: > The game is played by Alice and Bob. Initially, there are $n$ stones. > The players alternate turns, making a move described below, with Alice going first. Th","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc145_b"},"statements":[{"statement_type":"Markdown","content":"The following game is called Game $n$:\n\n> The game is played by Alice and Bob. Initially, there are $n$ stones.\n> The players alternate turns, making a move described below, with Alice going first. The player who becomes unable to make a move loses.\n> \n> *   In Alice's turn, she must remove a number of stones that is a positive multiple of $A$.\n> *   In Bob's turn, he must remove a number of stones that is a positive multiple of $B$.\n\nIn how many of Game $1$, Game $2$, ..., Game $N$ does Alice win when both players play optimally?\n\n## Constraints\n\n*   $1 \\leq N ,A,B \\leq 10^{18}$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $A$ $B$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc145_b","tags":[],"sample_group":[["4 2 1","2\n\nIn Game $1$, Alice cannot make a move and thus loses.\nIn Game $2$, Alice removes $2$ stones, and then Bob cannot make a move: Alice wins.\nIn Game $3$, Alice removes $2$ stones, Bob removes $1$ stone, and then Alice cannot make a move and loses.\nIn Game $4$, Alice removes $2 \\times 2 = 4$ stones, and then Bob cannot make a move: Alice wins.\nTherefore, Alice wins in two of the four games."],["27182818284 59045 23356","10752495144"]],"created_at":"2026-03-03 11:01:14"}}