This is the tiling [roblem question of hackerblocks

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

int find(int n,int m){
//if(n<=3)
// return 0;

return find(n-m,m)+find(n-1,m);

}

int main(){
int t;
ll n,m;
cin>>t;
while(t–){
cin>>n>>m;

	int x=find(n,m);
	cout<<x<<endl;
}
return 0;

}

The base case you have taken is wrong . The correct one will be
if(n==m)
return 2;
if(n<m)
return 1;
if it will be giving tle then it will be solved by dp.