cmath里有ceil函数,意为向上取整。

//Author:yanhaoyang2106
//O(1)
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a;
    cin>>n>>m>>a;
    printf("%.0lf",ceil(n*1.0/a)*ceil(m*1.0/a));
    return 0;
}

Be will and be good!