I use GNU C++ to solve this problem. I passed all test from #1 to #14. But, I am wrong at test #15
1000000000 1000000000 999999999
But my answer is 4.
I think 999999999 ^ 2 can't cover the area of Theater Square 1000000000 ^ 2. Thus, we should use 4 flagstones to cover area of Theaer Square, can't use only 1 flagstone.
Please help me!
Here's my soucre code
using namespace std;
float m, n, k;
cin >> n >> m >> k;
float horizontal = m / k;
float vertical = n / k;
int horizontalInt = (int) horizontal;
int verticalInt = (int) vertical;
if (horizontalInt < horizontal)
if (verticalInt < vertical)
cout << horizontalInt * verticalInt;