Description
用 a∗a 的砖铺满一个 n∗m 的地面问最少需要几块
Input
三个整数 n,m,a(1≤n,m,a≤109)
Output
输出最少需要几块砖
Sample Input
6 6 4
Sample Output
4
Solution
水题, ans=⌈na⌉⌈ma⌉
Code
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<ctime>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const int INF=0x3f3f3f3f,maxn=100001;
int n,m,a;
int main()
{
while(~scanf("%d%d%d",&n,&m,&a))
{
int x=(n+a-1)/a,y=(m+a-1)/a;
printf("%I64dn",(ll)x*y);
}
return 0;
}
最后
以上就是饱满外套最近收集整理的关于CodeForces 1 A.Theatre Square(水~)的全部内容,更多相关CodeForces内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复