3 2 7 6
4 You can make $A$ satisfy the condition with four operations as follows. * Choose $i=1$, and increase $A_1$ by $1$ and decrease $A_2$ by $1$, making $A=(3,6,6)$. * Choose $i=1$, and increase $A_1$ by $1$ and decrease $A_2$ by $1$, making $A=(4,5,6)$. * Choose $i=2$, and increase $A_2$ by $1$ and decrease $A_3$ by $1$, making $A=(4,6,5)$. * Choose $i=1$, and increase $A_1$ by $1$ and decrease $A_2$ by $1$, making $A=(5,5,5)$. This is the minimum number of operations required, so print $4$.
3 -2 -5 -2
2 You can make $A$ satisfy the condition with two operations as follows: * Choose $i=1$, and decrease $A_1$ by $1$ and increase $A_2$ by $1$, making $A=(-3,-4,-2)$. * Choose $i=2$, and increase $A_2$ by $1$ and decrease $A_3$ by $1$, making $A=(-3,-3,-3)$. This is the minimum number of operations required, so print $2$.
5 1 1 1 1 -7
13 By performing the operations appropriately, with $13$ operations you can make $A=(0,0,-1,-1,-1)$, which satisfies the condition in the problem statement. It is impossible to satisfy it with $12$ or fewer operations, so print $13$.
{
"problem": {
"name": "Approximate Equalization",
"description": {
"content": "You are given an integer sequence of length $N$: $A=(A_1,A_2,\\ldots,A_N)$. Takahashi can perform the following two operations any number of times, possibly zero, in any order. * Choose an integer $",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc307_g"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given an integer sequence of length $N$: $A=(A_1,A_2,\\ldots,A_N)$.\nTakahashi can perform the following two operations any number of times, possibly zero, in any order.\n\n* Choose an integer $...",
"is_translate": false,
"language": "English"
}
]
}