RIOI_3_2 - Counting
Given integers N and M, output in how many ways you can take N distinct positive integers such that sum of those integers is <= M. Since result can be huge, output it modulo 1000000007 (10^9 + 7)
N <= 20
M <= 100000
First line of input is number t, number of test cases. Each test case consists only of 2 numbers N and M, in that order.
Output number aksed in description.
O(NM) should work fine gareev
I am getting TLE using iterative DP in O(N * M * sqrt(M)) algorithm. Can anyone give me hints about improvements or more efficient solutions?