fork download
  1. /***> @author : a_e_kasem <***/
  2. // ﷽
  3. // { وَأَنْ لَيْسَ لِلْإِنْسَانِ إِلَّا مَا سَعَى }
  4. //
  5. // فَالجُهدُ يُثمِرُ إنْ تَضافَرَ صَفوُهُ، والعَزمُ يَرفعُ صَرحَ كُلِّ بُنيانِ
  6. //
  7. // وَما نَيلُ المَطالِبِ بِالتَمَنّي
  8. // وَلَكِن تُؤخَذُ الدُنيا غِلابا
  9. // ***
  10. // وَما اِستَعصى عَلى قَومٍ مَنالٌ
  11. // إِذا الإِقدامُ كانَ لَهُم رِكابا
  12. //
  13. #include <bits/stdc++.h>
  14. using namespace std;
  15.  
  16. #define int long long
  17. #define cinAll(a) for (auto &it : a) cin >> it
  18. #define all(x) (x).begin(), (x).end()
  19. #define NO void(cout << "NO\n")
  20. #define YES void(cout << "YES\n")
  21.  
  22. struct custom_hash {
  23. static uint64_t splitmix64(uint64_t x) {
  24. // http://x...content-available-to-author-only...i.it/splitmix64.c
  25. x += 0x9e3779b97f4a7c15;
  26. x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
  27. x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
  28. return x ^ (x >> 31);
  29. }
  30. size_t operator()(uint64_t x) const {
  31. static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
  32. return splitmix64(x + FIXED_RANDOM);
  33. }
  34. };
  35.  
  36.  
  37. void solve() {
  38. int n, m, a; cin >> n >> m >> a;
  39.  
  40. int ans = 0;
  41. if (n % a == 0) ans += n/a;
  42. else ans += (n / a)+1;
  43.  
  44. if (m % a == 0) ans *= m/a;
  45. else ans *= (m / a)+1;
  46.  
  47. cout << ans << '\n';
  48. }
  49.  
  50.  
  51.  
  52.  
  53. void FastIO();
  54. int32_t main() {
  55. FastIO();
  56.  
  57. int t = 1;
  58. // cin >> t;
  59. while(t--)
  60. {
  61. solve();
  62. }
  63.  
  64. return 0;
  65. }
  66.  
  67. void FastIO()
  68. {
  69. // freopen("input.txt", "r", stdin);
  70. // freopen("output.txt", "w", stdout);
  71. ios::sync_with_stdio(false);
  72. cin.tie(nullptr);
  73. cout.tie(nullptr);
  74. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
0