3 5 1 2 1
8
There are four sequences $B$ such that $\prod _{i = 1} ^N \dbinom{B_i}{A_i}$ is at least $1$:
* $B = {1, 2, 1}$, where $\prod _{i = 1} ^N \dbinom{B_i}{A_i} = \dbinom{1}{1} \times \dbinom{2}{2} \times \dbinom{1}{1} = 1$;
* $B = {2, 2, 1}$, where $\prod _{i = 1} ^N \dbinom{B_i}{A_i} = \dbinom{2}{1} \times \dbinom{2}{2} \times \dbinom{1}{1} = 2$;
* $B = {1, 3, 1}$, where $\prod _{i = 1} ^N \dbinom{B_i}{A_i} = \dbinom{1}{1} \times \dbinom{3}{2} \times \dbinom{1}{1} = 3$;
* $B = {1, 2, 2}$, where $\prod _{i = 1} ^N \dbinom{B_i}{A_i} = \dbinom{1}{1} \times \dbinom{2}{2} \times \dbinom{2}{1} = 2$.
The sum of these is $1 + 2 + 3 + 2 = 8$.10 998244353 31 41 59 26 53 58 97 93 23 84
642612171
{
"problem": {
"name": "Binomial Coefficient is Fun",
"description": {
"content": "We have a sequence $A$ of $N$ non-negative integers. Compute the sum of $\\prod _{i = 1} ^N \\dbinom{B_i}{A_i}$ over all sequences $B$ of $N$ non-negative integers whose sum is at most $M$, and print it",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc110_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "We have a sequence $A$ of $N$ non-negative integers.\nCompute the sum of $\\prod _{i = 1} ^N \\dbinom{B_i}{A_i}$ over all sequences $B$ of $N$ non-negative integers whose sum is at most $M$, and print it...",
"is_translate": false,
"language": "English"
}
]
}