1A - Theatre Square【数学】
来源:互联网 发布:淘宝上七天无理由退货 编辑:程序博客网 时间:2024/05/15 15:55
A. Theatre Square
time limit per test
1 secondmemory limit per test
256 megabytesinput
standard inputoutput
standard outputTheatre 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
#include<cstdio>#include<cmath>#include<cstring>using namespace std;typedef long long ll;int main(){ll n,m,a;while(~scanf("%I64d%I64d%I64d",&n,&m,&a)){ll x=ceil(n*1.0/a),y=ceil(m*1.0/a);printf("%I64d\n",x*y);}return 0;}
0 0
- 1A - Theatre Square【数学】
- CodeForces 1A-Theatre Square【数学】
- CodeForces 1A Theatre Square 【数学】【精度】
- 1A. Theatre Square
- 1A--Theatre Square
- 1A - Theatre Square
- 1A. Theatre Square
- 1A Theatre Square
- 1A. Theatre Square
- 1A. Theatre Square
- Codeforces Beta Round #1 / 1A Theatre Square (简单数学)
- 【codeforces 1A】Theatre Square——数学,水
- CodeForces 1A Theatre Square(模拟+简单数学)
- A - Theatre Square比赛1
- CodeForces 1A Theatre Square
- CF#1A. Theatre Square
- Codeforces 1A. Theatre Square
- Codeforce 1A. Theatre Square
- hdu 5442 Favorite Donut(后缀数组)
- spring boot应用启动原理分析
- 测平
- Linux下安装python包——psutil
- 【TRIO-Basic从入门到精通教程三】轴参数的含义
- 1A - Theatre Square【数学】
- FTP服务配置
- redis 多数据库
- 【Leetcode】Roman to Integer
- Java动态代理详解
- weka使用
- 【Leetcode】Excel Sheet Column Title
- 【Leetcode】Excel Sheet Column Number
- leetcode-Linked List Cycle II-142