algorithm

더블릿|dovelet - 타일수 구하기/tiles

블루건 2016. 7. 21. 20:00

문제


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <cmath>
 
using namespace std;
 
int main()
{
    int x, y;
    cin >> x >> y;
 
    int perfectTiles = (x / 8* (y / 8);
    int remainTiles = (ceil((double)x / 8)* ceil((double)y / 8)) - (int)(floor(x / 8* floor(y / 8));
    cout << "The number of whole tiles is " << perfectTiles << " part tiles is " << remainTiles;
 
    return 0;
}
cs