Advertisement
wojiaocbj

X

Jun 11th, 2022
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. typedef long long LL;
  4. typedef unsigned long long ULL;
  5. ULL comb[121][121];
  6. int main(){
  7.     int m,n,t;
  8.     comb[1][1] = 1;
  9.     for(n = 2;n <= 120;n++){
  10.         for(m = 1;m <= n;m++){
  11.             comb[m][n] = comb[m - 1][n - 1] + comb[m][n - 1];
  12.         }
  13.     }
  14.     scanf("%d",&t);
  15.     while(t--){
  16.         scanf("%d%d",&n,&m);
  17.         if(m > n){
  18.             puts("You're kidding me!");
  19.         }
  20.         else{
  21.             printf("%llu\n",comb[m + 1][n + 1]);
  22.         }
  23.  
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement