题目:
描述:给定一个n*m的矩形,要求用a*a的正方形块实现全覆盖,可以超出矩形的面积
题解:看矩形的两条边分别需要多少a才能全覆盖。
代码:
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
int n,m;
scanf("%d%d",&n,&m);
int a;
scanf("%d",&a);
__int64 l,r;
l = (n % a == 0) ? n / a : n / a + 1;
r = (m % a == 0) ? m / a : m / a + 1;
printf("%I64d\n",l * r);
return 0;
}