2 5
12 There are $12$ good arrays: $[1, 1]$, $[1, 2]$, $[1, 3]$, $[2, 1]$, $[2, 2]$, $[2, 4]$, $[3, 1]$, $[3, 3]$, $[3, 4]$, $[4, 2]$, $[4, 3]$, $[4, 4]$.
4 3
8 There are $8$ good arrays: $[1, 1, 1, 2]$, $[1, 1, 2, 1]$, $[1, 2, 1, 1]$, $[2, 1, 1, 1]$, $[2, 2, 2, 1$\], $[2, 2, 1, 2]$, $[2, 1, 2, 2]$, $[1, 2, 2, 2]$.
5000 99999989
51699346
2021 307
644635349
{
"problem": {
"name": "Nondivisible Prefix Sums",
"description": {
"content": "You are given a prime number $P$, which you don't like. Let's call an array of integers $A_1, A_2, \\dots, A_N$ **good**, if it is possible to reorder the elements in such a way that no prefix sum is d",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc052_c"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a prime number $P$, which you don't like.\nLet's call an array of integers $A_1, A_2, \\dots, A_N$ **good**, if it is possible to reorder the elements in such a way that no prefix sum is d...",
"is_translate": false,
"language": "English"
}
]
}