#include
#include<bits/stdc++.h>
#define ll long double
using namespace std;
ll fact(ll n)
{
if((n==0)||(n==1))
return 1;
else
return n*fact(n-1);
}
int main() {
ll t;
cin>>t;
while(t–)
{
ll n,k,p,res,x,y;
cin>>n>>k;
p=n-k;
x= fact(p+k-1);
y=fact(k-1)*fact§;
res=x/y;
cout<<res<<endl;
}
return 0;
}
It is working fine everywhere else including coding blocks IDE.
I even unlocked the test cases to verify. And the test cases which are showing wrong answer here, are working fine when manually entered in coding blocks IDE