-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
题意:
n*m的长方形要铺上a*a的地砖,问需要多少块?
思路:
长和宽判断是否整除,不整除加上1,相乘即可
代码:
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int n, m, a;
long long solve(){
long long one = (n%a==0)?(n/a):(n/a)+1;
long long two = (m%a==0)?m/a:(m/a)+1;
return (one * two);
}
int main(){
cin>>n>>m>>a;
cout<<solve()<<endl;
return 0;
}