THis is from Challenges-Mathematics section.Can u please tell me why its failing for test case 2 and 3

#include
#include
#include
#define ll long long
using namespace std;

ll getC(ll N,ll R){
if(R>N-R)
R=N-R;
if(R==0)
return 1;
ll Num=1;
ll Den=1;
while® {
Num*=N;
Den*=R;
ll dvsr=__gcd(Num,Den);
Num/=dvsr;
Den/=dvsr;
N–;
R–;
}
return Num;
}
int main() {

int t;
cin>>t;
ll inp[t][2];
for(int i=0;i<t;i++)
	cin>>inp[i][0]>>inp[i][1];
for(int i=0;i<t;i++)
	if( inp[i][0]==inp[i][1])
	cout<<"1"<<endl;
	else if(inp[i][0] < inp[i][1])
	cout<<"0"<<endl;
	else 
	cout<<getC(inp[i][0]-1,inp[i][1]-1)<<endl;
return 0;

}

@shellcodingblock Ans for this will be n+k-1C k-1

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.