Theatre Square
http://codeforces.com/problemset/problem/1/A
AC代码:
#include<iostream> #include<cstdio> using namespace std; int main() { __int64 m,n,a,sum,x,y; while(scanf("%I64d%I64d%I64d",&n,&m,&a)!=EOF) { if(n%a == 0) { x = n/a; } else { x = n/a+1; } if(m%a == 0) { y = m/a; } else { y = m/a+1; } // printf("%I64d %I64d\n",x,y); sum = x*y; printf("%I64d\n",sum); } return 0; }