How Many Ways

Dexter has N coins having values 1, 2, 3, . . . , N . He should select a subset of exactly K coins from those such that the selected coins sum to N. Find how many ways he can do it. Suppose, N = 8, K = 3 then he can select coins in 2 ways: {1,2,5}, {1,3,4}. Input First line of input is T (≤ 20) which is the number of cases. Then there are T lines each containing two numbers K (1 ≤ K ≤ 10) and N (1 ≤ N ≤ 109). Output Output the number of ways to choose K coins MOD 1000000007. Sample Input 3 4 10 38 4 231 Sample Output 1 2 80142