我是靠谱客的博主 多情帆布鞋,这篇文章主要介绍codeforces--Theatre Square,现在分享给大家,希望可以做个参考。

Theatre Square
Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u
Submit  Status
Appoint description: 

Description

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.

Input

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

Output

Write the needed number of flagstones.

Sample Input

Input
复制代码
1
6 6 4
Output
复制代码
1
4
使用————int64

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <cstdio> #define LL __int64 int main() { LL n , m , a ; scanf("%I64d %I64d %I64d", &n, &m, &a) ; if( n % a ) n = n/a + 1 ; else n /= a ; if( m % a ) m = m/a + 1 ; else m /= a ; printf("%I64dn", n*m); return 0 ; }


最后

以上就是多情帆布鞋最近收集整理的关于codeforces--Theatre Square的全部内容,更多相关codeforces--Theatre内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(59)

评论列表共有 0 条评论

立即
投稿
返回
顶部