描述:
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.
What is the least number of flagstones needed to pave the Square? It's allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It's not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.
输入:
The input contains three positive integer numbers in the first line: n, m and a (1 ≤ n, m, a ≤ 109).
输出:
Write the needed number of flagstones.
描述:
在伯兰首都的剧院广场是一个尺寸为 n x m 米的矩形的形状。在这座城市的周年纪念日这个特殊的时刻,做出了一个用正方形的花岗岩石板去铺广场的决定。每一块石板的尺寸都是 a x a 。
问最少需要多少块石板去铺广场?允许覆盖比剧院广场更大的表面,但广场必须被覆盖。不允许打破石板。石板的边沿应与广场的边沿平行。
输入:
第一行输入包括三个正整数:n, m, a (1 ≤ n, m, a ≤ 109)
输出:
编写程序输出需要的石板数量。
题目地址链接:Problem - A - Codeforces