codeforces 1A

注意开long long。

#include<cstdio>
#include<cctype>
#include<algorithm>
using namespace std;
int read(){
    char c; while(!isdigit(c=getchar())); int x=c-'0';
    while(isdigit(c=getchar())) x=x*10+c-'0'; return x;
}
int calc(int n,int a){
    return n%a? n/a+1:n/a;
}
int main(){
    int n=read(),m=read(),a=read();
    printf("%lld",(long long)calc(n,a)*calc(m,a));
    return 0;
}

 

posted @ 2017-10-30 19:07  或是七一  阅读(228)  评论(0编辑  收藏  举报