We're given the dimensions of a quadrilateral with side lengths $n, m$. We need to completely cover the 2-dimensional area using square tiles with given side length $a$. The bounds for this problem $\betw[1]{n,m,a}{10^9}$.
This is just simple modular arithmetic. We have a bunch of square tiles that will end up covering at least $n$ in one direction, and $m$ in the other. If we know how many tiles we need in the $X$-coordinate ($\floor{\frac{n}{a}} + y$, where $y = 1$ if $n \divs a$, else $y = 0$), and how many tiles we need in the $Y$-coordinate, then the answer is just the product of those two numbers.
Since we're dealing with large input ranges $\left[ 1, 10^9 \right]$, that could , you need to use a larger type such as long long for C++. Using a typical 32-bit signed int will overflow.