Solution for DMOPC '14 Contest 1 P2 - Tiles in C++


May 2, 2020 0.099835 seconds C++
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	int l, w, t; 
	cin >> l >> w >> t;
	
	if(t > l || t > w){
		cout << 0;
		return 0;
	}
	
	l = floor(l / t);
	w = floor(w / t);
	cout << l * w;
	
	return 0;
}

Editorial


No editorial for this problem. :(

Original Problem


You can view the original page for this problem on the DMOJ.