A. Theatre Square
time limit per test

1 second

memory limit per test

256 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.

Examples
input
6 6 4
output
4

水题但是错了n次,归其原因还是对C语言不太熟悉,很多东西我还都不知道——int64,什么时候用这个,真的不太了解,未来的路还很长,加油

AC代码

#include<stdio.h>
#include<math.h> int main()
{
__int64 n,m,a;
__int64 L,W; scanf("%I64d%I64d%I64d",&n,&m,&a);
if( n%a == )
L = n/a;
else
L = n/a + ; if( m%a == )
W = m/a;
else
W = m/a + ; printf("%I64d\n", W*L); return ;
}

A. Theatre Square(math)的更多相关文章

  1. Educational Codeforces Round 88 (Rated for Div. 2) B. New Theatre Square(贪心)

    题目链接:https://codeforces.com/contest/1359/problem/B 题意 有一块 $n \times m$ 的地板和两种瓷砖: $1 \times 1$,每块花费为 ...

  2. 组合数学(math)

    组合数学(math) 题目描述 为了提高智商,zjy开始学习组合数学.某一天她解决了这样一个问题:“给一个网格图,其中某些格子有财宝.每次从左上角出发,只能往右或下走.问至少要走几次才能把财宝全部捡完 ...

  3. js 算數(Math)對象

    算數對象不需要聲明,可以直接使用, Math對象方法及作用: round()四捨五入: random()生成0到1的隨機數: max()選擇較大的數: min()返回較小的數:

  4. Digital Square(hdu4394)搜索

    Digital Square Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...

  5. HDU 1518 Square(DFS)

    Problem Description Given a set of sticks of various lengths, is it possible to join them end-to-end ...

  6. UVA 11520 Fill the Square(模拟)

    题目链接:https://vjudge.net/problem/UVA-11520 这道题我们发现$n\leq 10$,所以直接进行暴力枚举. 因为根据字典序所以每个位置试一下即可,这样的复杂度不过也 ...

  7. HDU1518 Square(DFS)

    Square Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Su ...

  8. Codeforces 112B-Petya and Square(实现)

    B. Petya and Square time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  9. 模拟摇奖:从1-36中随机抽出8个不重复的数字(math)

    public class Yaojiang { public static void main(String[] args) { // TODO 自动生成的方法存根 int[] a=new int[8 ...

随机推荐

  1. PAT L3-008. 喊山(BFS)C4 初赛30分

    喊山(30 分) 喊山,是人双手围在嘴边成喇叭状,对着远方高山发出“喂—喂喂—喂喂喂……”的呼唤.呼唤声通过空气的传递,回荡于深谷之间,传送到人们耳中,发出约定俗成的“讯号”,达到声讯传递交流的目的. ...

  2. FileStream 常用的属性和方法

    FileStream常用的属性和方法 (转) 对流进行操作时要引用 using System.IO; 命名空间 FileStream常用的属性和方法: 属性: CanRead 判断当前流是否支持读取, ...

  3. 在U盘分区安装Kali并引导live CD 教程以及常见的注意事项

    Kali Linux作为强大的全能渗透系统,把它制成Live CD基本算是必备技能了,但是官方提供的文档虽然简单,但是整个U盘都会被占用,确实是有点可惜,结合网上提供的一些思路加上自己的经验,向大家讲 ...

  4. Weblogic wls RCE 漏洞验证POC

    #!/usr/bin/env python # coding:utf-8 # @Date : 2017/12/22 17:11 # @File : weblogic_poc.py # @Author ...

  5. 实验吧CTF题库-安全杂项

    XDCTF misc200: 题目提示: 下载文件 用foremost分离文件 接下来用archpr 4.53进行明文攻击 先把00002700.zip中的readme.txt提取出来压缩成zip文件 ...

  6. MySQL组合索引最左匹配原则

    几个重要的概念 1.对于mysql来说,一条sql中,一个表无论其蕴含的索引有多少,但是有且只用一条. 2.对于多列索引来说(a,b,c)其相当于3个索引(a),(a,b),(a,b,c)3个索引,又 ...

  7. pyodbc连接MySQL数据库

    1:Python安装pyodbc:pip install pyodbc 2:安装unixODBC-2.3.4.tar.gz ./configure make make install 3:下载基于py ...

  8. log4j配置文件加载方式

    使用背景: apache的log4j是一个功能强大的日志文件,当我们使用eclipse等IDE在项目中配置log4j的时候,需要知道我们的配置文件的加载方式以及如何被加载的. 加载方式: (1).自动 ...

  9. C语言学习笔记--递归函数

    1. 递归函数的思想 (1)递归是一种数学上分而自治的思想,是将大型复杂问题转化为与原问题相同但规模较小的问题进行处理的一种方法 (2)递归需要有边界条件 ①当边界条件不满足时,递归继续进行 ②当边界 ...

  10. bitcode编译错误

    xcode编译引用的静态库可能会出现编译错误: does not contain bitcode. You must rebuild it with bitcode enabled (Xcode se ...