Marbles ques doubt

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

int marbles(ll n,ll k)
{
ll ans=1,i;
if(n==k)
return 1;
if(k>(n-k))
k=n-k;

for(i=0;i<k;i++)
{
    ans=ans*(n-i)/(i+1);
}
return ans;

}

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

cout<<marbles(n-1,k-1)<<endl;
}
return 0;

}

clearing only one test case out of 5 plz tell me the issue

@saiKDr it is told in the problem statement that ans can exceed 64 bit int limit hence you cannot store ans in long long int you have to use bigint() here
Take a look at its implementation here https://github.com/robinrst/HackerBlocks/blob/master/MARBLES.cpp
And here i have updated your code using bigInt() https://ide.codingblocks.com/s/215222