2 3
998244349 4 Here are all possible $a$ and the corresponding $f(a)$. * $a=(0,0)$: $f(a)=(-2,-1)$ * $a=(0,1)$: $f(a)=(-1,-1)$ * $a=(0,2)$: $f(a)=(-1,0)$ * $a=(0,3)$: $f(a)=(-1,1)$ * $a=(1,1)$: $f(a)=(-1,0)$ * $a=(1,2)$: $f(a)=(0,0)$ * $a=(1,3)$: $f(a)=(0,1)$ * $a=(2,2)$: $f(a)=(0,1)$ * $a=(2,3)$: $f(a)=(1,1)$ * $a=(3,3)$: $f(a)=(1,2)$ Thus, the sum of the first elements is $-4$, and the sum of the second elements is $4$.
3 4
998244329 0 24
4 6
998244233 35 175 330
10 1000000
297189103 747015740 88545731 123651717 920498165 977169022 775771117 810877103 152407094 602233731
{
"problem": {
"name": "Sort A[i]-i",
"description": {
"content": "You are given positive integers $N$ and $M$. Here, $N<M$. A sequence of $N$ non-negative integers $a=(a_1,a_2,\\cdots,a_N)$ is said to be a **good** sequence when it satisfies the following condition: ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 5000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "wtf22_day1_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given positive integers $N$ and $M$. Here, $N<M$.\nA sequence of $N$ non-negative integers $a=(a_1,a_2,\\cdots,a_N)$ is said to be a **good** sequence when it satisfies the following condition:\n...",
"is_translate": false,
"language": "English"
}
]
}