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; }