原题链接:http://codeforces.com/problemset/problem/1/A

Theatre Square

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)(1≤n,m,a≤109)(1 ≤  n, m, a ≤ 10^9).

Output

Write the needed number of flagstones.

Examples
input

6 6 4

output

4

题解

我第一次还忘开long longlonglonglong\ long了,我怎么这么菜。

代码
#include<bits/stdc++.h>
using namespace std;
int n,m,a;
bool f1,f2;
void in(){scanf("%d%d%d",&n,&m,&a);}
void ac(){f1=n%a,f2=m%a;printf("%lld",1ll*(n/a+f1)*(m/a+f2));}
int main(){in();ac();}

CF1A Theatre Square相关推荐

  1. 蒟蒻君的刷题日记Day1:CF1A Theatre Square

    文章目录 题目大意 解题思路 代码实现 题目大意 有一个n×mn \times mn×m的矩阵,你需要用若干个a×aa \times aa×a的正方形填满ta. 正方形不能切割,可以超出这个矩阵,但不 ...

  2. CF Theatre Square

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

  3. Theatre Square

    time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...

  4. 【CodeForces - 1A】Theatre Square(水题,几何)(CODEFORCES,梦的开始)

    题干: Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters ...

  5. CodeForces-1A Theatre Square【水题】

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

  6. CodeForces 1A Theatre Square(水题)

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

  7. CodeForces刷题:Theatre Square、Watermelon、Chat Server‘s Outgoing Traffic、Triangle、Die Roll

    记录Codeforces刷题QAQ 一.Theatre Square 题面翻译 用 $ a \times a$ 的石板覆盖 $n \times m $ 的长方形广场,允许石板覆盖的区域超出广场,不允许 ...

  8. cf 1A Theatre Square

    在刷完十多道CF A,B题水题后 ,便迫不及待的开始写下我的第一篇博客,以此来纪念我ACM的开始 . 纯小白,代码有很多不足之处,希望大家指教.也希望我的解题报告可以对大家有那么一点点的帮助. 1,C ...

  9. 1A. Theatre Square

    1A. Theatre Square 题目 翻译 题目 输入 输出 分析 代码 题目 翻译 题目 首都柏林的剧院广场是一个n×m 的矩形.在城市周年纪念之际,决定用方形的花岗岩石板铺砌广场,每个石板大 ...

  10. E - Theatre Square

    E - Theatre Square 一个城市的广场面积有 N×M平方米,过段时间,恰逢这个城市的庆典活动,主办方决定在广场上铺设一种新的地砖,这种地砖每块都是a×a平方米的. 那么问题来了,最少需要 ...

最新文章

  1. python工程师薪资坑吗-Python中反人类直觉的特性,你踩过坑吗?
  2. (转)写的非常好的一个WPF学习之路
  3. linux 的 cat more less 命令有什么区别
  4. matlab引言,MATLAB论文
  5. java 数组随机抽取_Java利用数组随机抽取幸运观众
  6. Android EditText监测(TextWatcher)输入后延时500ms再搜索
  7. 全链路压测原理篇(方案 概念 架构 实现)
  8. matlab二次曲线插补,圆弧插补器插补非圆二次曲线的方法
  9. android面试题整理(上)
  10. CSDN页面上方广告条太烦人?js写个油猴脚本给它隐藏了~
  11. openssl官网-下载安装过程
  12. Qlikview---变量
  13. Android 图片选取画图案
  14. office2016的word打开程序之后显示需要修复问题解决解决
  15. 你应该具有的富人思维
  16. cogs 313. [POI2001] 和平委员会(2-SAT
  17. Macbook Pro 外接显卡实现Tensorflow GPU运行之环境配置(重点)
  18. 影视剪辑副业真的可以月入过万吗?
  19. 逆水寒服务器维护到几点,逆水寒开启转服,这些事项你要知道!
  20. Ubuntu安装 Realtek R8125 驱动

热门文章

  1. 当 p<1时,p 范数不满足三角不等式的证明 | p norm | triangle inequality
  2. Raki的读paper小记:ELECTRA: PRE-TRAINING TEXT ENCODERS AS DISCRIMINATORS RATHER THAN GENERATORS
  3. 725.分隔链表(力扣leetcode) 博主可答疑该问题
  4. 巨牛,访问github速度加快数倍
  5. 对于PHP面试知识点的小结
  6. 洛谷 1315 观光公交——贪心
  7. Queue与生产者消费者模型
  8. DP:最大公共子序列
  9. MyBatis源码阅读(十二) --- Spring加载MyBatis过程
  10. 面试题之cookie和session区别