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.  
  23.  
  24. void solve() {
  25. int n, m, a; cin >> n >> m >> a;
  26.  
  27. int ans = 0;
  28. if (n % a == 0) ans += n/a;
  29. else ans += (n / a)+1;
  30.  
  31. if (m % a == 0) ans *= m/a;
  32. else ans *= (m / a)+1;
  33.  
  34. cout << ans << '\n';
  35. }
  36.  
  37.  
  38.  
  39.  
  40. void FastIO();
  41. int32_t main() {
  42. FastIO();
  43.  
  44. int t = 1;
  45. // cin >> t;
  46. while(t--)
  47. {
  48. solve();
  49. }
  50.  
  51. return 0;
  52. }
  53.  
  54. void FastIO()
  55. {
  56. // freopen("input.txt", "r", stdin);
  57. // freopen("output.txt", "w", stdout);
  58. ios::sync_with_stdio(false);
  59. cin.tie(nullptr);
  60. cout.tie(nullptr);
  61. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
0