分糖果
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Candies
题目描述
颗糖分给 个人,第 个人至少分得 颗,至多分得 颗,必须分完,求方案数,答案对 取模。
输入格式
第一行两个整数 ,第二行 个整数 。
输出格式
一个整数表示最后结果。
样例 #1
样例输入 #1
3 4
1 2 3
样例输出 #1
5
样例 #2
样例输入 #2
1 10
9
样例输出 #2
0
样例 #3
样例输入 #3
2 0
0 0
样例输出 #3
1
样例 #4
样例输入 #4
4 100000
100000 100000 100000 100000
样例输出 #4
665683269
数据范围
样例解释 1
种合法方案如下。 - - - - -
2023-2024第二学期初一信息竞赛组期末考
- Status
- Done
- Rule
- IOI
- Problem
- 4
- Start at
- 2024-6-24 10:45
- End at
- 2024-6-24 16:03
- Duration
- 1.5 hour(s)
- Host
- Partic.
- 41