fork download
  1. /* hng */
  2. #include <bits/stdc++.h>
  3. /*
  4. #pragma GCC optimize("O3,unroll-loops")
  5. #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
  6. */
  7. #define fast \
  8.   ios::sync_with_stdio(false); \
  9.   cin.tie(nullptr); \
  10.   cout.tie(nullptr);
  11. #define fi first
  12. #define se second
  13. #define pr pair
  14. #define ll long long
  15. #define ull unsigned long long
  16. #define db double
  17. #define vt vector
  18. #define pb(a) push_back(a) //push_back()
  19. #define umap unordered_map
  20. #define ln '\n'
  21. using namespace std;
  22.  
  23. const string NAME = "test";
  24. const ll MAXN = 1e6 + 36;
  25. const ll MOD = 1e9 + 7;
  26. const ll lmin = LLONG_MIN;
  27. const ll lmax = LLONG_MAX;
  28. /*-------------------------------------------------------------*/
  29. int main()
  30. {
  31. fast;
  32.  
  33. #ifndef ONLINE_JUDGE
  34. freopen((NAME + ".inp").c_str(), "r", stdin);
  35. freopen((NAME + ".out").c_str(), "w", stdout);
  36. #endif
  37.  
  38. auto start = chrono::steady_clock::now();
  39.  
  40. ll k, a, b;
  41. cin >> k >> a >> b;
  42. cout << (b / k) - ((a - 1) / k);
  43.  
  44. auto end = chrono::steady_clock::now();
  45. cerr << "Time = " << chrono::duration<double>(end - start).count() << 's';
  46. }
  47.  
Success #stdin #stdout #stderr 0s 5324KB
stdin
3 6 14
stdout
3
stderr
Time = 2.1842e-05s