Tilling problem using recursion

#include
#include
#include
#define mod 1000000007
using namespace std;

int tiling(int n,int m){
if(n==m)
return 2;
if(1<=n&&n<m)
return 1;
if(n==1)
{
return 1;
}

return (tiling(n-m,m-1)%mod+tiling(n-1,m)%mod)%mod;

}
int main() {
int t;
cin>>t;

while(t--){
    int n,m;
    cin>>n>>m;
    cout<<tiling(n,m)%mod<<endl;
}

}

@jontysingla85 I would suuggest you to attempt this question only after completing the Dynamic Programming Section of your course. Since the test case are largeā€¦recursive solution will fail and will give Time Limit Error.