Advertisement
STANAANDREY

triplu stecher (15) 20pct

Dec 28th, 2021
1,447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. constexpr int MOD = 666013;
  4.  
  5. int getFact(int n) {
  6.     int r = 1;
  7.     for (int i = 1; i <= n; i++) {
  8.         r = 1LL * r * i % MOD;
  9.     }
  10.     return r;
  11. }
  12.  
  13. signed main() {
  14.     int n, k;
  15.     cin >> n >> k;
  16.     cout << getFact(n) / getFact(n - k) << endl;
  17.     return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement