Can u pls tell what's wrong with my code. It passes only Test Case 4 and not the previous ones

#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {

int t;
cin>>t;
while(t--)
{
	int a,k;
	cin>>a>>k;

	int ans = 1;
    if(a-k>0){
    for(int i=a-1;i>=a-k+1;i--)
	{
         ans = ans * i;
		 ans = ans/(a-i);
	}

    cout<<ans<<"\n";
	}
	else
	cout<<1<<"\n";


}
return 0;

}

You need to use bigint() to avoid overflow, long long int isn’t sufficient.

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.