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. 蒙特卡洛法计算定积分—Importance Sampling

    如上图所示,计算区间[a  b]上f(x)的积分即求曲线与X轴围成红色区域的面积.下面使用蒙特卡洛法计算区间[2  3]上的定积分:∫(x2+4*x*sin(x))dx # -*- coding: u ...

  2. [HDU5727]Necklace(二分图最大匹配,枚举)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5727 题意:有N个阴珠子和N个阳珠子,特定序号的阴阳珠子放在一起会让阳珠子暗淡.现在问排放成一个环,如 ...

  3. mysql数据小姿势

    CREATE TABLE `information` (  `NUMBER` bigint(20) NOT NULL AUTO_INCREMENT,//将number设为自增字段  `USER_NAM ...

  4. [Java解惑]类

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

  5. sp_getTable_data

    CREATE PROC sp_Select_Table ) AS begin ) SET @sql='SELECT * FROM ' + @TableName EXEC (@sql) end GO

  6. JAVA中Response的几种用法(设定时间调整到指定页面 ....... )

    <%@ page language="java" import="java.util.*" pageEncoding="gbk"%&g ...

  7. C++大数类模板

    友情提示:使用该模板的注意了,在大数减法里有一个小错误,导致减法可能会出错 // 原来的写法,将t1.len错写成了len ] == && t1.len > ) { t1.len ...

  8. MyEclipse中文乱码解决方法

    在Myeclipse导入一个项目,有中文乱码问题,解决方法如下: 一.将整个project设置编码UTF-8(UTF-8可以最大的支持国际化) windows->Preferences-> ...

  9. Android notifications通知栏的使用

    app发送通知消息到通知栏中的关键代码和点击事件: package com.example.notifications; import android.os.Bundle; import androi ...

  10. 键盘控制div移动

    <!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8&qu ...