It is running for sample test case but not accepting

Where i am wrong
#include
#define ll long long
using namespace std;

ll ans = 0;

void tile(ll x, ll y, ll n, ll m)
{
//cout<<n<<" "<<m<<endl;
if((n==0) || (m==0))
{
ans++;
return;
}
if(n<0 || m<0)
{
return;
}
if(m>=x)
{
tile(x,y,n-1,m);
}
if(n>=y)
{
tile(x,y,n,m-1);
}
}

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

while(t--)
{
	ans=0;
	ll n,m;
	cin>>n>>m;
	tile(n,m,n,m);
	cout<<ans<<endl;
}
return 0;

}

@sourabhboss
hello sourabh,
can u pls explain ur recurrence relation

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.