#include <iostream>
using namespace std;
long long mod = 1000000007 ;
int countWays(int n , int m , int x){
if(n==m) return 2 ;
if(n < m) return 1 ;
return (countWays(n - x , m-1 ,x) + countWays(n-1 , m ,x))%mod ;
}
int main() {
// your code goes here
int t;
cin >> t ;
while(t--){
int n,m;
cin >> n >> m ;
cout<<countWays(n , m , m)%mod<<"\n" ;
}
}
What is the problem in this code ?