Problem B. Problem B. Harvest of Apples

时间限制 2000 ms   内存限制 256 MB

There are $n$ apples on a tree, numbered from $1$ to $n$.
Count the number of ways to pick at most $m$ apples.
 

输入数据

The first line of the input contains an integer $T$ $(1 \le T \le 10 ^ 5)$ denoting the number of test cases.
Each test case consists of one line with two integers $n, m$ $(1 \le m \le n \le 10 ^ 5)$.
 

输出数据

For each test case, print an integer representing the number of ways modulo $10 ^ 9 + 7$.
 

样例输入

复制
2
5 2
1000 500

样例输出

复制
16
924129523

提交

请先 登录

© 2025 FAQs Contact About