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 ...
随机推荐
- \r与\n有何区别,编码的时候应该如何使用
\r与\n有何区别,编码的时候应该如何使用 区别: \r: 全称:carriage return (carriage是“字车”的意思,打印机上的一个部件) 简称:return 缩写:r ASCII码: ...
- Hibernate 查询语句
Hibernate查询语言(HQL)是一种面向对象的查询语言,类似于SQL,但不是对表和列操作,HQL适用于持久对象和它们的属性. HQL查询由Hibernate转换成传统的SQL查询,这在圈上的数据 ...
- CUBRID学习笔记 12防火墙设置 linux
这玩意是linux上用的. 如果你的数据库不是装在linux下可以飘过了 iptables -I INPUT -p tcp --dport 8001 -j ACCEPT iptables -I INP ...
- win 8 pip install 或者 pycharm 安装 paramiko 报错
这是安装时报错的最后几行 creating build\temp.win-amd64-3.5\Release\build creating build\temp.win-amd64-3.5\Relea ...
- javascript权威指南笔记--javascript语言核心(六)
通过ECMAScript 3创建的属性都是可写的.可枚举的.可配置的. 在ECMAScript 5中,数据属性的4个特性分别是它的值.可写性.可枚举性.可配置性.存取器属性的特性是读取.写入.可枚举性 ...
- iOS - Swift PList 数据存储
前言 直接将数据写在代码里面,不是一种合理的做法.如果数据经常改,就要经常翻开对应的代码进行修改,造成代码扩展性低.因此,可以考虑将经常变的数据放在文件中进行存储,程序启动后从文件中读取最新的数据.如 ...
- FileCopy
/*[入]指的是到内存里,[出]指的是到内存外*/ import java.io.*; public class MyReadFile{ public static void main(String[ ...
- mysql 大数据量求平均值
需求是:对于一个设备,求一天内每个小时的平均值,一个月内每天的平均值,更通用的需求是,从起始时间到结束时间,每隔一段时间,求一个平均值.目前的解决策略是:在存储过程中进行处理,从起始时间到结束时间,切 ...
- 用JS打开网页时自动更改css样式,可用于处理浏览器兼容
代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8 ...
- wireshark使用教程
Wireshark: https://www.wireshark.org/ 安装: apt-get install wireshark 教程: http://blog.csdn.net/leichel ...