Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
- #define ll long long
- #define ld double
- #define llu long long unsigned
- int main()
- {
- fast;
- int t;
- cin>>t;
- for( int c = 1 ; c <= t ; c++ )
- {
- cout<<"Case "<<c<<": ";
- int n , k;
- cin>>n>>k;
- if( n < k )
- {
- cout<<0<<endl;
- continue;
- }
- llu ans = 1;
- for( int i = 1 ; i <= k ; i++ )
- {
- ans *= pow( n - i + 1 , 2 );
- }
- for( int i = 1 ; i <= k ; i++ )
- ans /= i;
- cout<<ans<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement