Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <iomanip>
  4. #include <vector>
  5. #include <map>
  6. #include <algorithm>
  7. #include <string>
  8. #include <cmath>
  9. #include <set>
  10. #include <unordered_set>
  11. #include <unordered_map>
  12. #include <chrono>
  13. #include <stack>
  14. #include <cassert>
  15. #include <queue>
  16. #include <deque>
  17. #include <climits>
  18. #include <cstring>
  19. #include <random>
  20. #include <bitset>
  21.  
  22. using namespace std;
  23.  
  24. #define int long long
  25.  
  26. int sum(int n) {
  27. return (n) * (n + 1) / 2 - 1;
  28. }
  29.  
  30. signed main() {
  31. ios_base::sync_with_stdio(false);
  32. cin.tie(nullptr);
  33.  
  34. #ifdef LOCAL
  35. assert(freopen("input.txt", "r", stdin));
  36. assert(freopen("output.txt", "w", stdout));
  37. #endif
  38.  
  39. int n;
  40. cin >> n;
  41. int best = 0;
  42. for (int i = 2; i < n; i++) {
  43. int tmp = n / i;
  44. best += sum(tmp);
  45. }
  46. cout << 4 * best;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement