cf--------(div1)1A. Theatre Square
2 seconds
64 megabytes
standard input
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.
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.
6 6 4
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的更多相关文章
- codeforce 1A Theatre Square
A. Theatre Square Theatre Square in the capital city of Berland has a rectangular shape with the siz ...
- CodeForces 1A Theatre Square
A - Theatre Square Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u ...
- 1A Theatre Square
题目大意; 有一个广场,广场的大小是n*m, 有a*a的石砖,石砖铺广场可以比广场大,石砖不能切割.问最少需要多少个石砖. ===================================== ...
- CF Theatre Square
Theatre Square time limit per test 2 seconds memory limit per test 64 megabytes input standard input ...
- Theatre Square
http://codeforces.com/problemset/problem/1/A Theatre Square time limit per test 2 seconds memory lim ...
- A. Theatre Square(math)
A. Theatre Square time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- Educational Codeforces Round 88 (Rated for Div. 2) B、New Theatre Square C、Mixing Water
题目链接:B.New Theatre Square 题意: 你要把所有"." 都变成"*",你可以有两个选择,第一种就是一次铺一个方块(1*1),第二种就是同一 ...
- 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 ...
- cf(#div1 B. Dreamoon and Sets)(数论)
B. Dreamoon and Sets time limit per test 1 second memory limit per test 256 megabytes input standard ...
随机推荐
- 【翻译】Anatomy of a Program in Memory—剖析内存中的一个程序(进程的虚拟存储器映像布局详解)
[翻译]Anatomy of a Program in Memory—剖析内存中的一个程序(进程的虚拟存储器映像布局详解) . . .
- CUBRID学习笔记 41 sql语法之select
cubrid的中sql查询语法 SELECT [ ] [{TO | INTO} ][FROM ] [WHERE ][GROUP BY {col_name | expr} [ASC | DESC], . ...
- iOS添加广告的主要方法
//用户取消正在执行的广告时 调用 - (void)cancelBannerViewAction { NSLog(@"Banner was cancelled!"); self.a ...
- Python numpy学习笔记(一)
下边代码是关于numpy的一些基本用法,包括数组和矩阵操作等... import numpy as np print "<== print version ==>" p ...
- UpdatePanel的简单用法(转)
微软AJAX虽然是过时的玩意,但是得维护公司之前的老项目,转载看看. 局部更新是ajax技术的最基本,也是最重要的用法,今天大概把asp.net ajax中的局部更新控件 updatepanel的用法 ...
- CISCO VPN出现网关报错
今天尝试使用发现报错: 重启VPN服务即可
- 表单美化-原生javascript和jQuery下拉列表(兼容IE6)
效果: 思想:用其他标签配合脚本和隐藏的input并通过传值模拟表单元素中的select <!DOCTYPE HTML> <html lang="en-US"&g ...
- Data Science 和 Finance 两个领域的融合是什么样子的?
Data Science 和 Finance 两个领域的融合是什么样子的? 2015-05-24 董可人 现在大部分人所说的Quant一般是指各大投行里做衍生品定价,信用评估,风险控制之类工作的人,这 ...
- Asp.net上传文件Request.files获取不到文件
使用ftp上传文件,并且Request.files获取文件,今天发现获取到的文件个数始终是0个,查了下原来form标签中需加入enctype=”multipart/form-data”,呵呵了 < ...
- mysql5.1版本 my.cnf中复制的配置不起作用
原因是:在mysql存放数据的目录下面有一个文件master.info,mysql服务器认为 master.info比my.cnf优先级要高,第一次启动slave,master.info不存在,从my ...