主页 讨论版 问题 名次 状态 统计

请自觉遵守比赛规则,违者严惩,不接受求情!

问题 B: Water Problem: Items divided

问题 B: Water Problem: Items divided

时间限制:2000 ms 内存限制:128 MB
提交:193 解决:39
[ 提交][ 状态][ 讨论版]

题目描述

Youyouyouyou is very interested in math, one day, an idea came into his mind that how many ways he can patition n same things into no more than m groups? he think it too hard for him, so youyouyouyou ask wise cyt for help, but wise cyt don’t want to talk with youyouyouyou because it is too easy for him, now can you help youyouyouyou solve this problem?

输入

multi test cases, two integers n and m(1<=m<=n<=1000) , end with n = m = 0.

输出

output an answer modulo 1e9 + 7 per line

样例输入

4 3 0 0

样例输出

4

提示

1+1+2 = 1+3=2+2 = 4

please use printf and scanf.

[ 提交][ 状态][ 讨论版]
Baidu
map