I am getting TLE error even after using the modulo
#include
using namespace std;
int f(long long int n,long long int m){
if(n<m && n>=0){
return 1;
}
if(n<0){
return 0;
}
int ans;
ans=f(n-1,m) + f(n-m,m);
return ans;
}
int main() {
int t;
cin>>t;
while(t–){
long long int n,m;
cin>>n>>m;
cout<< f(n,m)<<endl;
}
return 0;
}