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 ;
}

最新文章

  1. the import javax.servlet
  2. HNU 12812 Broken Audio Signal
  3. C++ 简单中文敏感词检测工具类
  4. [java学习笔记]java语言基础概述之数组的定义&amp;常见操作(遍历、排序、查找)&amp;二维数组
  5. PLSQL 循环示例
  6. Spring MVC集成slf4j-logback
  7. 1101: 零起点学算法08——简单的输入和计算(a+b)
  8. VS2010 c/c++ 本地化 emscripten 配置
  9. 测试与发布(Beta版本)
  10. JS 作用域(执行环境)与作用链---JS 学习笔记(二)
  11. the pitfull way to create a uClinux image including gdb.
  12. linux grep find查找文件夹、代码中的某行/字符串
  13. 3143 二叉树的序遍历codevs
  14. (原创)C++11改进我们的程序之简化我们的程序(三)
  15. 【转】关于HTTP服务器每个客户端2个连接的限制
  16. linux 守护进程(daemon process)代码-详细注释
  17. Rust语言学习笔记(4)
  18. jenkins中管理用户
  19. SpringBoot的配置属性文件*.properties值如何映射到类中使用
  20. Linux中JDK的安装步骤

热门文章

  1. [转载]python datetime处理时间
  2. DCloud-5+Runtime:杂项
  3. mysql 异常宕机 ..InnoDB: Database page corruption on disk or a failed,,InnoDB: file read of page 8.
  4. Spring 学习一 @Autowired
  5. python学习笔记(一):python简介和入门
  6. (转)newInstance()和new()
  7. sql 的积累
  8. AudioManager 音量『转』
  9. php中COM函数的使用
  10. JavaScript中的匿名函数及函数的闭包(转)