Why does my code gives TLE?

Why does my code gives TLE when i am supposed to apply recursion in it? If we are supposed to apply dp , then should’ve put it in dp section.

#include<bits/stdc++.h>
using namespace std;

int tiling(int n , int m){
if(n==m){
return 2;
}
if(n<=1 || n<m){
return 1;
}
return ((tiling(n-m , m)%1000000007)+(tiling(n-1 , m)%1000000007))%1000000007;
}

int main(){
int t;
cin>>t;
while(t–){
int n,m;
cin>>n>>m;
cout<<tiling(n,m)<<endl;
}
return 0;
}

hello @chetan_aggarwalbX1

yeah u need to solve this problem using dp.

already informed to the team, they will remove this soon

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.