5 3 6 11 2 5 5 5 20 0
10 71 29 We have $A=(6,11,2,5,5)$ and three questions in this input. For the $1$\-st question, you can change every element of $A$ to $5$ in $10$ operations as follows. * Subtract $1$ from $A_1$. * Subtract $1$ from $A_2$ six times. * Add $1$ to $A_3$ three times. It is impossible to change every element of $A$ to $5$ in $9$ or fewer operations. For the $2$\-nd question, you can change every element of $A$ to $20$ in $71$ operations. For the $3$\-rd question, you can change every element of $A$ to $0$ in $29$ operations.
10 5 1000000000 314159265 271828182 141421356 161803398 0 777777777 255255255 536870912 998244353 555555555 321654987 1000000000 789456123 0
3316905982 2811735560 5542639502 4275864946 4457360498 The output may not fit into $32$\-bit integers.
{
"problem": {
"name": "±1 Operation 2",
"description": {
"content": "You are given a sequence of length $N$: $A=(A_1,A_2,\\dots,A_N)$. The following action on this sequence is called an _operation_. * First, choose an integer $i$ such that $1 \\le i \\le N$. * Next, ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc255_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a sequence of length $N$: $A=(A_1,A_2,\\dots,A_N)$. The following action on this sequence is called an _operation_.\n\n* First, choose an integer $i$ such that $1 \\le i \\le N$.\n* Next, ...",
"is_translate": false,
"language": "English"
}
]
}