3 1 10 2 1 2 21 476523737 103976339 266993 706803678 802362985 892644371 953855359 196462821 817301757 409460796 773943961 488763959 405483423 616934516 710762957 239829390 55474813 818352359 312280585 185800870 255245162
Second
First
Second
* In test case $1$, Jiro the second wins. Below is one sequence of moves that results in Jiro's win:
* In Taro the first's turn, he can only choose Bag $1$ and move the coins onto Dish $1$.
* In Jiro the second's turn, he can choose Dish $1$ and remove all coins from it, making Taro fail to make a move and lose.
* Note that when there is a bag that contains coin(s), a player can only make a move in which he chooses a bag that contains coin(s) and moves the coin(s) onto a dish.
* Similarly, note that when there is no bag that contains coin(s), a player can only make a move in which he chooses a dish and removes one or more coins.{
"problem": {
"name": "Let's Play Nim",
"description": {
"content": "We have $N$ bags numbered $1$ through $N$ and $N$ dishes numbered $1$ through $N$. Bag $i$ contains $a_i$ coins, and each dish has nothing on it initially. Taro the first and Jiro the second will play",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc105_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "We have $N$ bags numbered $1$ through $N$ and $N$ dishes numbered $1$ through $N$. Bag $i$ contains $a_i$ coins, and each dish has nothing on it initially.\nTaro the first and Jiro the second will play...",
"is_translate": false,
"language": "English"
}
]
}