前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >cf--------(div1)1A. Theatre Square

cf--------(div1)1A. Theatre Square

作者头像
Gxjun
发布2018-03-26 10:24:26
6410
发布2018-03-26 10:24:26
举报
文章被收录于专栏:mlml

A. Theatre Square

time limit per test

2 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

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 test(s)

Input

代码语言:javascript
复制
6 6 4

Output

代码语言:javascript
复制
4
只想说。。。。。。。。。。。。。。
代码:
代码语言:javascript
复制
 1 #include<iostream>
 2 using namespace std;
 3 int main()
 4 {
 5   int n,m,a,b,c;
 6   while(scanf("%d%d%d",&n,&m,&a)!=EOF){
 7      c=n/a;
 8      b=m/a;
 9     if(n%a) c++;
10      if(m%a) b++;
11      cout<<(long long)c*b<<endl;
12  }
13   return 0;
14 }
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014-08-18 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档