3 2 686926217
1 The only such array is $[2, 2, 2]$, for which exists a permutation $[1, 2, 3]$.
4 3 354817471
9 There are $9$ such arrays: $[2, 2, 2, 2]$, $[2, 2, 2, 3]$, $[2, 2, 3, 2]$, $[2, 2, 3, 3]$, $[2, 3, 2, 2]$, $[2, 3, 3, 2]$, $[3, 2, 2, 2]$, $[3, 3, 2, 2]$, $[3, 3, 3, 3]$.
5 2 829412599
1 The only such array is $[2, 2, 2, 2, 2]$.
5 3 975576997
23
69 42 925171057
801835311
{
"problem": {
"name": "Weird LIS",
"description": {
"content": "You are given integers $N$ and $M$. Find the number of arrays $A=[A_1, A_2, \\ldots, A_N]$ of length $N$ such that the following conditions hold: * $2 \\le A_i \\le M$ ($1 \\leq i \\leq N$) * There ex",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc055_c"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given integers $N$ and $M$. Find the number of arrays $A=[A_1, A_2, \\ldots, A_N]$ of length $N$ such that the following conditions hold:\n\n* $2 \\le A_i \\le M$ ($1 \\leq i \\leq N$)\n* There ex...",
"is_translate": false,
"language": "English"
}
]
}