fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. unsigned long long int npok( unsigned int n, unsigned int k )
  6. {
  7. if( k == 0 || k == n ) return 1;
  8. if( n > 0 && k > 0 && n > k ) return npok( n - 1, k ) + npok( n - 1, k - 1 );
  9. }
  10.  
  11. int main ()
  12. {
  13. int ile;
  14. cin>>ile;
  15. for (int i=0; i<ile; i++)
  16. {
  17. unsigned long long int a,b;
  18. cin>>a>>b;
  19. cout<<npok(a,b)<<endl;
  20. }
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 4376KB
stdin
Standard input is empty
stdout
Standard output is empty