原题链接: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. 6000毫安以上智能手机_6000大电池+骁龙8核处理器,Redmi新机来袭:价格太美
  2. UART的16倍频过采样和3倍频过采样
  3. 渗透知识-sqlmap
  4. mysql修改表、字段、库的字符集(转)
  5. mysql的内存表和临时表
  6. java调用so库中的native方法_Java如何调用本地.so库里的方法
  7. android 网络调试工具,安卓网络调试助手
  8. Java GregorianCalendar hashCode()方法与示例
  9. 八、IO优化(6)优化tempdb性能
  10. Struts2 整合jQuery实现Ajax功能
  11. linux14.10硬盘安装,Windows 10下硬盘安装Ubuntu 14.10图文教程
  12. edge css兼容,CSS输入错误样式在Edge浏览器中无法正确显示
  13. php checkbox后台判断是否选中,jquery如何判断是否选中checkbox
  14. Jmeter之JDBC Request与mysql
  15. jQuery CSS 添加/删除类名
  16. 极域电子教室V4窗口化
  17. 使用 Litho 改进 News Feed 上的 Android 视频表现
  18. Windows Server2012 服务器修改密码过期时间
  19. 米家和苹果HomeKit二选一,你怎么选?
  20. 巧用 Dummy 解决断网情况下的网络访问问题

热门文章

  1. matlab连接散射点,使用小波散射做信号分类
  2. NOIP 2015复赛提高组Day2 T1==Codevs 4768 跳石头
  3. vim 插件之supertab
  4. mysql从一个表中拷贝数据到另一个表中sql语句
  5. svg转换pdf用php实现,如何使用javascript在JSPDF中将SVG文件转换为PDF
  6. 【Spring-AOP】源码分析汇总
  7. 【Spring-IOC】Spring中的数据校验
  8. Zookeeper开源客户端curator
  9. Java线程 生产者--消费者模式总结(一)
  10. SpringBoot中Interceptor和Filter的使用