![]() |
||||||||||
|
||||||||||
Problem B. Harvest of ApplesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 5855 Accepted Submission(s): 2139 Problem Description There are $n$ apples on a tree, numbered from $1$ to $n$. Count the number of ways to pick at most $m$ apples. Input 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)$. Output For each test case, print an integer representing the number of ways modulo $10 ^ 9 + 7$. Sample Input
Sample Output
Source | ||||||||||
|