Codeforces-SolutionsA/1A-Theater Square/1A.cpp

22 lines
371 B
C++
Raw Normal View History

2023-06-07 22:14:37 +08:00
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n, m, a, div, len, wid;
cin >> n >> m >> a;
div = n / a;
if (n % a == 0)
len = div * a;
else
len = (div + 1) * a;
div = m / a;
if (m % a == 0)
wid = div * a;
else
wid = (div + 1) * a;
div = (len * wid) / (a * a);
cout << div;
}