1 3 8 1
3 Since there is only one district, whoever wins the seat in that district wins the election. If three voters for Aoki in the district switch to Takahashi, there will be six voters for Takahashi and five for Aoki, and Takahashi will win the seat.
2 3 6 2 1 8 5
4 Since there are more seats in the second district than in the first district, Takahashi must win a majority in the second district to win the election. If four voters for Aoki in the second district switch sides, Takahashi will win five seats. In this case, Aoki will win two seats, so Takahashi will win the election.
3 3 4 2 1 2 3 7 2 6
0 If Takahashi will win the election even if zero voters switch sides, the answer is $0$.
10 1878 2089 16 1982 1769 13 2148 1601 14 2189 2362 15 2268 2279 16 2394 2841 18 2926 2971 20 3091 2146 20 3878 4685 38 4504 4617 29
86
{
"problem": {
"name": "President",
"description": {
"content": "Takahashi and Aoki are competing in an election. There are $N$ electoral districts. The $i$\\-th district has $X_i + Y_i$ voters, of which $X_i$ are for Takahashi and $Y_i$ are for Aoki. ($X_i + Y_i$",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc317_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Takahashi and Aoki are competing in an election. \nThere are $N$ electoral districts. The $i$\\-th district has $X_i + Y_i$ voters, of which $X_i$ are for Takahashi and $Y_i$ are for Aoki. ($X_i + Y_i$...",
"is_translate": false,
"language": "English"
}
]
}