Advertisement
7oSkaaa

B

Feb 24th, 2023
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.71 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define fixed(n) fixed << setprecision(n)
  6. #define ceil(n, m) (((n) + (m) - 1) / (m))
  7. #define add_mod(a, b, m) (((a % m) + (b % m)) % m)
  8. #define sub_mod(a, b, m) (((a % m) - (b % m) + m) % m)
  9. #define mul_mod(a, b, m) (((a % m) * (b % m)) % m)
  10. #define all(vec) vec.begin(), vec.end()
  11. #define rall(vec) vec.rbegin(), vec.rend()
  12. #define sz(x) int(x.size())
  13. #define debug(x) cout << #x << ": " << (x) << "\n";
  14. #define fi first
  15. #define se second
  16. #define ll long long
  17. #define ull unsigned long long
  18. #define EPS 1e-9
  19. constexpr int INF = 1 << 30, Mod = 1e9 + 7;
  20. constexpr ll LINF = 1LL << 62;
  21. #define PI acos(-1)
  22. template < typename T = int > using Pair = pair < T, T >;
  23. vector < string > RET = {"NO", "YES"};
  24.  
  25. template < typename T = int > istream& operator >> (istream &in, vector < T > &v) {
  26.     for (auto &x : v) in >> x;
  27.     return in;
  28. }
  29.  
  30. template < typename T = int > ostream& operator << (ostream &out, const vector < T > &v) {
  31.     for (const T &x : v) out << x << ' ';
  32.     return out;
  33. }
  34.  
  35. void Solve(){
  36.     ll n;
  37.     cin >> n;
  38.     ll ans = 0;
  39.     for(ll i = 1; n - 3 * i >= 1; i++){
  40.         ll up = n - 3 * i;
  41.         if(up % 7 != 0) continue;
  42.         ll to_find = up / 7;
  43.         for(int j = 1; j <= sqrt(to_find); j++){
  44.             if(to_find % j == 0){
  45.                 ans++;
  46.                 if(to_find / j != j) ans++;
  47.             }
  48.         }
  49.     }
  50.     cout << ans << "\n";
  51. }
  52.  
  53. int main(){
  54.     ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  55.     int test_cases = 1;
  56.     // cin >> test_cases;
  57.     for(int tc = 1; tc <= test_cases; tc++){
  58.         // cout << "Case #" << tc << ": ";
  59.         Solve();
  60.     }
  61.     return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement