3 2 2 3
2 In the first round, if Aoki specifies $K_1=2$, Takahashi cannot win whichever option he chooses for $S_1$: $1$, $2$, or $3$. For example, if Takahashi writes $S_1=1$ on the initial blackboard, the two operations will change this number as follows: $1\to 2(=A_1)$, $2\to 2(=A_2)$. The final number on the blackboard will be $2(\neq 1)$, so Aoki wins. On the other hand, in the second and third rounds, Takahashi can win by writing $2$ and $3$, respectively, on the initial blackboard, whatever value Aoki specifies as $K_i$. Therefore, if both players play optimally to win, Takashi wins two rounds: the second and the third. Thus, you should print $2$.
2 2 1
2 In the first round, Takahashi can win by writing $2$ on the initial blackboard if $K_1$ specified by Aoki is odd, and $1$ if it is even. Similarly, there is a way for Takahashi to win the second round. Thus, Takahashi can win both rounds: the answer is $2$.
{
"problem": {
"name": "Transition Game",
"description": {
"content": "You are given a sequence of $N$ numbers: $A=(A_1,A_2,\\ldots,A_N)$. Here, each $A_i$ $(1\\leq i\\leq N)$ satisfies $1\\leq A_i \\leq N$. Takahashi and Aoki will play $N$ rounds of a game. For each $i=1,2,\\",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc296_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a sequence of $N$ numbers: $A=(A_1,A_2,\\ldots,A_N)$. Here, each $A_i$ $(1\\leq i\\leq N)$ satisfies $1\\leq A_i \\leq N$.\nTakahashi and Aoki will play $N$ rounds of a game. For each $i=1,2,\\...",
"is_translate": false,
"language": "English"
}
]
}