• Source
    1. #include<stdio.h>
    2. #include<math.h>
    3. #include<stdlib.h>
    4.  
    5. int main()
    6. {
    7. double n,m,a;
    8. double ans;
    9.  
    10. while(scanf("%lf %lf %lf",&n,&m,&a)==3){
    11.  
    12. double tmp=ceil(n/a);
    13. double tmp1=ceil(m/a);
    14.  
    15. //printf("%lf\n",tmp);
    16. // printf("%lf\n",tmp1);
    17.  
    18. ans= tmp*tmp1;
    19.  
    20. printf("%.0lf\n",ans);
    21.  
    22. }
    23.  
    24.  
    25. return 0;
    26. }