CF1A.Theatre Square

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

伯兰首都的剧院广场呈矩形,尺寸为 n×mn \times m 米。为庆祝城市周年纪念,决定使用正方形花岗岩铺路石铺设整个广场。每块铺路石的尺寸为 a×aa \times a。

铺设整个广场所需的最少铺路石数量是多少?允许铺设面积大于剧院广场,但必须完全覆盖广场;不允许切割铺路石;铺路石的边必须与广场的边平行。

输入格式

The input contains three positive integer numbers in the first line: n,  m and a (1 ≤  n, m, a ≤ 109).

输入的第一行包含三个正整数:nn、mm 和 aa(1≤n,m,a≤1091 \leq n, m, a \leq 10^9)。

输出格式

Write the needed number of flagstones.

写出所需地砖的数量。

输入输出样例

  • 输入#1

    6 6 4

    输出#1

    4

输入解题思路,AI测评打分。不知道怎么写?

首页