Getting WA, c++ , possibly ans exceeds 66 bit (mentioned in question)

It is given answer will not fit in c++ 64 bit integer. How to solve this.
Here is my code

#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long
ll ncr(ll n,ll r){
    ll ans = 1;
    ll j = 1;
    for(ll i=n;i>n-r;i--){
        ans = ans *i;
        ans = ans/j;
        j++;
    }
    return ans;
}
ll countWays(ll n, ll k){
    if(n == k){
        return 1;
    }
    return ncr(n-1,k-1);
}
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        cout<<countWays(n,k)<<endl;
    }
}

please help with the same

@shivama_700 If you think that’s the reason as to why your code is failing then you need to use an implementation of bigint() class. Please pick the code from here https://github.com/robinrst/HackerBlocks/blob/master/MARBLES.cpp.
Here is the working code if you want to know how to use it https://ide.codingblocks.com/s/204104

You code is not running on the website, and yes I did comment INP(). Is there any other way to solve this question?

@shivama_700 It is running now ,the site was down yesterday. And yes there is no other way if you are doing it in C++.

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.