#include<bits/stdc++.h>
using namespace std;
int main()
{
unsigned long long T,n,k,ans,c=1,i;
cin >> T;
while(T--)
{
cin >> n >> k;
ans = 1;
if(n<k)
{
cout << "Case " << c++ << ": 0" << endl;
continue;
}
for(i=1; i<=k; i++)
{
ans = ans*n*n/i;
n -= 1;
}
cout << "Case " << c++ << ": " << ans << endl;
}
return 0;
}
Thursday, July 30, 2015
1005 - Rooks
Subscribe to:
Post Comments (Atom)
Triathlon
Triathlon - CodeChef # include < bits/stdc++.h > using namespace std ; # define fi first # define se second # define mp ...
-
# include < bits/stdc++.h > using namespace std ; int main ( ) { int T , c = 1 ; double r1 , r2 , h , p ; // ...
-
# include < bits/stdc++.h > using namespace std ; int main ( ) { long long T , S , l , n , c = 1 ; // freopen(&qu...
-
# include < bits/stdc++.h > using namespace std ; int main ( ) { int T , n , p , q , c = 1 , i , w , t , arry [ 50 ] ; ...
No comments:
Post a Comment