fork(6) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int testy, n, k;
  6.  
  7. int main()
  8. {
  9. cin>>testy;
  10. for (int i=0; i<testy; i++)
  11. {
  12. cin>>n>>k;
  13. int x=1;
  14. for (int j=n; j>(n-k); j--) x*=j;
  15. for (int j=1; j<=k; j++) x/=j;
  16. cout<<x<<endl;
  17. }
  18. }
  19.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Standard output is empty