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. 正确设置Linux的ulimit值的方法

    学习swoole的时候有一个max_conn参数, max_conn 描述:服务器允许维持的最大TCP连接数 说明:设置此参数后,当服务器已有的连接数达到该值时,新的连接会被拒绝.另外,该参数的值不能 ...

  2. WebDriver数据驱动模式

    利用@dataprovider 在一个浏览器内多次登录不同的用户时,必须要每次完成一个登录后,都有一个退出登录的代码,以保持和初始登录页面一致,才不会报错并再次循环登录

  3. java selenium webdriver第二讲 页面元素定位

    自动化测试实施过程中,测试程序中常用的页面操作有三个步骤 1.定位网页上的页面元素,并存储到一个变量中 2.对变量中存储的页面元素进行操作,单击,下拉或者输入文字等 3.设定页面元素的操作值,比如,选 ...

  4. MySQL查询某个字段为某值的次数统计SQL语句

    SELECT GoodID,sum(if(Level = 1, 1, 0)) as Better,sum(if(Level = 0, 1, 0)) as Nomal,sum(if(Level = -1 ...

  5. ConfigureAwait(false)

    昨天在做项目的时候,用的dapper查数据用的QueryAsync 异步方法.给上级做代码审核时,上级说最好加上ConfigureAwait(false).能减少一些性能开销. 因为之前没用过所以看了 ...

  6. div的作用

    <div></div>主要是用来设置涵盖一个区块为主,所谓的区块是包含一行以上的数据,所以在<div></div>的开始之前与结束后,浏览都会自动换行, ...

  7. flask 电影系统(2)

    标签,电影,上映预告数据模型设计 标签数据类型 id:编号 name:标题 movies:电影外键关联 addtime:创建时间 定义电影数据模型 id:编号 title:电影标题 url:电影地址 ...

  8. 部署和调优 2.1 squid正向代理

    安装squid yum install -y squid Squid 官方网站为 http://www.squid-cache.org 打开注释掉的 cache_dir ufs / 缓存目录的位置,大 ...

  9. ffmpeg: ‘UINT64_C’ was not declared in this scope (转)

    ffmpeg 默认是用C文件来编译的,如果某个CPP文件想引用ffmpeg中的某些函数或者头文件,有可能出现 ‘UINT64_C’ was not declared in this scope的错误 ...

  10. chosen.jquery插件的使用

    前几天在jQuery官网看到了插件里面有400多个插件,看了下效果都很好,以后项目里面难免会用到.于是下了个决定,有时间把官网的插件都研究下,并简单介绍他的用法,方便以后的使用. 下面将要提到的是jQ ...