fork download
  1. #include<iostream>
  2. using namespace std;
  3. int fact(int n)
  4. {
  5. if(n==1)
  6. return 1;
  7. return fact(n-1);
  8. }
  9. int main()
  10. {
  11. int Testnum, N, M;
  12. cin>>Testnum;
  13. for(int i=0; i<Testnum; i++)
  14. {
  15. cin>>N>>M;
  16. cout<<fact(M)/fact(N)*fact(M-N);
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 4824KB
stdin
3
2 2
1 5
13 29
stdout
111