AtCoder Grand Contest 049
翻译中…
Problem Statement
翻译中…
Given are integers $N$ and $M$. Find the number, modulo $(10^9+7)$, of length-$N$ sequences $(A_1,A_2,\ldots,A_N)$ that consist of non-negative integers and satisfy the following conditions:
翻译中…
$A_1+A_2+\ldots +A_N = M$;- For every
$i$($2 \leq i \leq N-1$),$2 A_i \leq A_{i-1} + A_{i+1}$.
翻译中…
Constraints
翻译中…
$1 \leq N \leq 10^5$$1 \leq M \leq 10^5$- All values in input are integers.
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
N M
翻译中…
Output
翻译中…
Print the number, modulo $(10^9+7)$, of sequences that satisfy the conditions.
翻译中…
样例
Input #1
3 3
Output #1
7
The following seven sequences satisfy the conditions.
- $0,0,3$
- $0,1,2$
- $1,0,2$
- $1,1,1$
- $2,0,1$
- $2,1,0$
- $3,0,0$
Input #2
10 100
Output #2
10804516
Input #3
10000 100000
Output #3
694681734
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。