int t,temp1=1,temp2=1,h=0,g=0;
cin>>t;
unsigned long long ans = 0;
int* a = new int[t];
int* k = new int[t];
int* n = new int[t];
for(int j=0;j<t;j++)
{
cin>>n[j];
cin>>k[j];
}
for(int i=0;i<t;i++)
{
if(k[i]==n[i])
ans = 1;
else
{
h = n[i]-1;
g = k[i]-1;
for(int j=0;j<k[i]-1;j++)
{
temp1 *= h;
temp2 *= g;
h--;
g--;
}
ans = temp1/temp2;
}
a[i] = ans;
}
for(int i=0;i<t;i++)
cout<<a[i]<<endl;
Please help I can’t figure out where I am going wrong.