Code not working?

This is my code for the problem MARBELS,

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

#define ll long long int

ll ncr(ll n, ll k){
	if(k > n)
	return 0;
	if(k==n)
	return 1;

	ll C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (ll j = min(i, k); j > 0; j--) 
            C[j] = ((C[j]%LONG_MAX) + (C[j-1]%LONG_MAX) )%LONG_MAX; 
    } 
    return C[k]; 
}

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

	while(t--) {
		ll n,k;
		cin>>n>>k;

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

Also, the code provided in solution is only passing one test case!

Answer can overflow 64-bit integer.
Refer this for big int class -:

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.