以下附代码
#include <bits/stdc++.h> using namespace std; int main() { long a,n,m,square,brick,lengh=0,wide=0; cin>>n>>m>>a; square=n*m; brick=a*a; lengh=n/a; wide=m/a; if(n%a!=0) lengh++; if(m%a!=0) wide++; cout<<lengh*wide; return 0; }