Why TLE is coming?

#include<bits/stdc++.h>
using namespace std;
int tilling(int n,int m)
{if(n>=1&&n<m)
{return 1;}
else if(n==m)
{
return 2;
}

return tilling(n-1,m)+tilling(n-2,m);

}
int main() {
int t;
cin>>t;
while(t–){
int n,m;
cin>>n>>m;
int ans=tilling(n,m);
ans%=(1000000000+7);
cout<<ans<<endl;
}
return 0;
}

hello @imambujsingh08
use dynamic programming to reduce its time complexity.

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.