Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- typedef long long LL;
- typedef unsigned long long ULL;
- ULL comb[121][121];
- int main(){
- int m,n,t;
- comb[1][1] = 1;
- for(n = 2;n <= 120;n++){
- for(m = 1;m <= n;m++){
- comb[m][n] = comb[m - 1][n - 1] + comb[m][n - 1];
- }
- }
- scanf("%d",&t);
- while(t--){
- scanf("%d%d",&n,&m);
- if(m > n){
- puts("You're kidding me!");
- }
- else{
- printf("%llu\n",comb[m + 1][n + 1]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement