cf--------(div1)1A. Theatre Square
A. Theatre Square
time limit per test
2 seconds
memory limit per test
64 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.
Sample test(s)
Input
6 6 4
Output
4
只想说。。。。。。。。。。。。。。
代码:
1 #include<iostream>
2 using namespace std;
3 int main()
4 {
5 int n,m,a,b,c;
6 while(scanf("%d%d%d",&n,&m,&a)!=EOF){
7 c=n/a;
8 b=m/a;
9 if(n%a) c++;
10 if(m%a) b++;
11 cout<<(long long)c*b<<endl;
12 }
13 return 0;
14 }
- 利用sharding-jdbc分库分表
- 利用sharding-jdbc分库分表
- 协议森林17 我和你的悄悄话 (SSL/TLS协议)
- spring-boot 速成(1) helloworld
- spring-boot 速成(1) helloworld
- 协议森林16 小美的桌号(DHCP协议)
- struts2(一)之初识struts2
- AI聊天机器人备受青睐 专家呼吁少卖萌
- CQRS框架:AxonFramework 之 Hello World
- Kubernetes的服务网格(第4部分):通过流量切换持续部署
- TortoiseGit安装与配置
- mongodb 速成笔记
- oAuth 2.0 笔记
- JavaScript内置对象--Math对象
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- LootCode-链表排序-Java
- 好久不用 jQuery, 来复习一下
- Spring学习一、组件注册
- 复习 EL 表达式与 JSTL
- Spring 学习二、Bean生命周期相关注解
- 十分钟学会 HTML
- 聊一下会话跟踪技术
- 朝花夕拾之Matlab基础回顾:向量的点积、叉积、混合积
- 详解响应消息 response
- Kubernetes 1.19.0——deployment(3)
- Selenium-01-测试环境搭建使用
- Selenium-02-常用元素定位
- SpringBoot + Vue 前后端分离项目下载视频文件踩坑记录
- Selenium-03-常用方法
- 用Python里面的Xpath完成一个在线汇率转换器