Kindly help me to optimize the code

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

int binomialCoeff(int n, int k);

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

int n,k;


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

	if(n==k)
	{
		cout<<1<<endl;
	}
	else
	{
        cout<<binomialCoeff(n-1, k-1)<<endl;
	}
}

}

int binomialCoeff(int n, int k)
{
// Base Cases
if (k > n)
return 0;

if (k == 0 || k == n)
    return 1;

// Recur
return binomialCoeff(n - 1, k - 1)
       + binomialCoeff(n - 1, k);

}

Hello @raj_pareek
Hey your variables ill overflow, its clearly mentioned that “You can assume that this number exceeds the limit of a signed 64-bit integer.”
Example 249 245
check this :


Happy Learning!!