5 3 101 6 101101 5 11111 6 000000 30 111011100110101100101000000111
1 2 -1 0 8 For the first test case, you can perform the operation with $(i,j)=(1,3)$ to make all the coins show tails in one operation. For the second test case, you can perform the operation with $(i,j)=(1,3)$ and then with $(i,j)=(4,6)$ to make all the coins show tails in two operations. For the third test case, you can prove that there is no way to make all the coins show tails, so you should print `-1`. For the fourth test case, the coins already show tails, so no operation is needed.
{
"problem": {
"name": "Non-Adjacent Flip",
"description": {
"content": "We have $N$ coins numbered $1$ to $N$ with two distinguishable sides. A string $S$ represents the current state of the coins. If the $i$\\-th character of $S$ is `1`, coin $i$ is showing heads; if that",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc156_a"
},
"statements": [
{
"statement_type": "Markdown",
"content": "We have $N$ coins numbered $1$ to $N$ with two distinguishable sides. A string $S$ represents the current state of the coins. If the $i$\\-th character of $S$ is `1`, coin $i$ is showing heads; if that...",
"is_translate": false,
"language": "English"
}
]
}