Advertisement
Josif_tepe

Untitled

Mar 9th, 2023
754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <algorithm>
  4. #include <set>
  5. using namespace std;
  6. typedef long long ll;
  7. void f(ll n) {
  8.     set<ll> st;
  9.     for(ll i = 0; i <= n; i++) {
  10.         for(ll j = 0; j <= n; j++) {
  11.             for(ll x = 0; x <= n; x++) {
  12.                 for(ll y = 0; y <= n; y++) {
  13.                     if(i + j + x + y == n) {
  14.                         st.insert(1 * i + 5 * j + 10 * x + 50 * y);
  15.                     }
  16.                 }
  17.             }
  18.         }
  19.     }
  20.     cout << (int) st.size() << endl;
  21. }
  22. int main()
  23. {
  24.     ios_base::sync_with_stdio(false);
  25.     int n;
  26.     cin >> n;
  27.     if(n <= 50) {
  28.         f(n);
  29.         return 0;
  30.     }
  31.     ll result = 2203;
  32.     int c = 50;
  33.     while(c + 1 <= n) {
  34.         c++;
  35.         result += 49;
  36.     }
  37.     cout << result << endl;
  38.  
  39.     return 0;
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement