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 ...
随机推荐
- jquery选择器 :first与:first-child区别
一个例子: <ul> <li>John</li> <li>Karl</li> <li>Brandon</li> ...
- Quick Trick About Using Dbms_Metadata With Forms_DDL In Oracle Forms
Example is given below to fetch any Oracle objects DDL script using DBMS_Metadata.Get_DDL command in ...
- application 网站计数器
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...
- sql 执行计划
SQL Server执行计划的理解 要理解执行计划,怎么也得先理解,那各种各样的名词吧.鉴于自己还不是很了解.本文打算作为只写懂的,不懂的懂了才写. 在开头要先说明,第一次看执行计划要注意,SQL S ...
- [C和指针]第五部分
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- Spring管理Bean的三种创建方式
1.使用类构造器实例化 (90%以上都是使用这种) <bean id=“orderService" class="cn.itcast.OrderServiceBean&qu ...
- NOJ 1063 生活的烦恼
描述 生活的暑假刚集训开始,他要决心学好字典树,二叉树,线段树和各种树,但生活在OJ上刷题的时候就遇到了一个特别烦恼的问题.那当然就是他最喜欢的二二叉树咯!题目是这样的:给你一颗非空的二叉树,然后再给 ...
- cocos2d-x 3.X(一)环境搭建问题
在按照官网上的教程(http://cn.cocos2d-x.org/tutorial/show?id=1478)步骤一步一步安装完成同时也添加了各项环境变量,运行cocos命令也没有任何问题,但就是在 ...
- Class.asSubclass浅谈
这是java.lang.Class中的一个方法,作用是将调用这个方法的class对象转换成由clazz参数所表示的class对象的某个子类.举例来说, 上面的代码将strList.getClass() ...
- Spring读书笔记-----Spring的Bean之Bean的基本概念
从前面我们知道Spring其实就是一个大型的工厂,而Spring容器中的Bean就是该工厂的产品.对于Spring容器能够生产那些产品,则取决于配置文件中配置. 对于我们而言,我们使用Spring框架 ...