CodeForces 1A

题目链接: http://codeforces.com/problemset/problem/1/A



题意给你一个n*m的矩形, 问你需要用多少块a*a的正方形才能将它覆盖



题解水题,想一想就是ceil(n/a) * ceil(m/a)


#include
#include
typedef long long int64;
int main ()
{
    int64 n, m, a;
    scanf("%lld %lld %lld", &n, &m, &a);
    printf("%I64d\n", (int64)ceil(1.0*n/a) * (int64)ceil(1.0*m/a));
    return 0;
}



你可能感兴趣的:(Codeforces,codeforces)