fork download
  1. #include<bits/stdc++.h>
  2. #define ull unsigned long long
  3. #define ll long long
  4. #define all(x) x.begin(), x.end()
  5. using namespace std;
  6. const int maxn = 2e5 + 1;
  7. ll sc12, sc6, sc, x, res = 0, d;
  8. int main() {
  9. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  10. ll m, n;
  11. cin >> m >> n;
  12. d = n - m + 1;
  13. res += (n - (m / 2) * 2 - 1)/2 + 1;
  14. sc = d - res;
  15. ll y = (m + 5) / 6 * 6;
  16. if(y<=n) sc6 = (n - y) / 6 + 1;
  17. else sc6 = 0;
  18. res += (sc - sc6) * 2;
  19. x = (m + 11) / 12 * 12;
  20. if (x <= n) sc12 = (n - x) / 12 + 1;
  21. else sc12 = 0;
  22. res += sc12 * 2;
  23. res += (sc6 - sc12) * 3;
  24. cout << res;
  25.  
  26.  
  27. }
  28.  
  29.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
72884885429439