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
6 6 4
Output
4
只想说。。。。。。。。。。。。。。
代码:
 #include<iostream>
using namespace std;
int main()
{
int n,m,a,b,c;
while(scanf("%d%d%d",&n,&m,&a)!=EOF){
c=n/a;
b=m/a;
if(n%a) c++;
if(m%a) b++;
cout<<(long long)c*b<<endl;
}
return 0;
}

cf--------(div1)1A. Theatre Square的更多相关文章

  1. codeforce 1A Theatre Square

    A. Theatre Square Theatre Square in the capital city of Berland has a rectangular shape with the siz ...

  2. CodeForces 1A Theatre Square

    A - Theatre Square Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u ...

  3. 1A Theatre Square

    题目大意; 有一个广场,广场的大小是n*m,  有a*a的石砖,石砖铺广场可以比广场大,石砖不能切割.问最少需要多少个石砖. ===================================== ...

  4. CF Theatre Square

    Theatre Square time limit per test 2 seconds memory limit per test 64 megabytes input standard input ...

  5. Theatre Square

    http://codeforces.com/problemset/problem/1/A Theatre Square time limit per test 2 seconds memory lim ...

  6. A. Theatre Square(math)

    A. Theatre Square time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  7. Educational Codeforces Round 88 (Rated for Div. 2) B、New Theatre Square C、Mixing Water

    题目链接:B.New Theatre Square 题意: 你要把所有"." 都变成"*",你可以有两个选择,第一种就是一次铺一个方块(1*1),第二种就是同一 ...

  8. cf(#div1 A. Dreamoon and Sums)(数论)

    A. Dreamoon and Sums time limit per test 1.5 seconds memory limit per test 256 megabytes input stand ...

  9. cf(#div1 B. Dreamoon and Sets)(数论)

    B. Dreamoon and Sets time limit per test 1 second memory limit per test 256 megabytes input standard ...

随机推荐

  1. Devexpress TreeList选择父级联动

    Treelist当显示复选框后,父级和子级的复选框没有关联,使用过程中很不便,如图所示 自己给treelist添加父子级联动 /// <summary> /// 初始化TreeList,父 ...

  2. Beaglebone Black–GPIO 开关 LED(三极管与继电器实验)

    上一篇,用 GPIO 直接供电给 LED,用高低电平作开关,不靠谱.GPIO 是信号用的,不是当电源用的.而且,一个 GPIO 只能给可怜的 5mA 左右,取多了会烧(我没烧过不知道是不是真的会烧,但 ...

  3. 使用source Insight工具创建uboot工程。

    首先在linux下面解压uboot的代码.不能在Windows下面解压,因为Windows的文件名是不区分大小写的. 然后,创建网络驱动器,这样就能在Windows下访问linux的文件夹了.方法:通 ...

  4. 11.Events

    1.A type that defines an event member allows the type (or instances of the type) to notify other obj ...

  5. [C程序设计语言]第四部分

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  6. Linux命令工具基础02 文件及目录管理

    文件及目录管理 文件管理不外乎文件或目录的创建.删除.查询.移动,有mkdir/rm/mv 文件查询是重点,用find来进行查询:find的参数丰富,也非常强大: 查看文件内容是个大的话题,文本的处理 ...

  7. python_way,day3 集合、函数、三元运算、lambda、python的内置函数、字符转换、文件处理

    python_way,day3 一.集合 二.函数 三.三元运算 四.lambda 五.python的内置函数 六.字符转换 七.文件处理 一.集合: 1.集合的特性: 特性:无序,不重复的序列 如果 ...

  8. 你是码农还是Geek?

    现在深深的体会到,不仅仅人与人的差别是巨大的,程序员与程序员之间的差别同样很明显的. 普通的程序员仅仅是完成自己的任务,完成任务后不思进取,不再修改自己的代码,不再去想有没有更好的实现方式,其实重构自 ...

  9. mysql中替换行首字符

    替换行首字符,而不替换字段中其它地方指定字符. UPDATE table SET open_time = CONCAT('W', open_time) WHERE open_time REGEXP ' ...

  10. linux学习笔记2-命令总结4

    帮助命令 help - 帮助命令 man - 获取帮助信息 用户管理命令 useradd - 添加新用户 passwd - 设置用户密码 who - 显示所有用户 w - 查看更详细的用户信息 use ...