hiho week 175 register

Ended

Participants:245

Verdict:Accepted
Score:100 / 100
Submitted:2017-11-07 20:26:23

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <bits/stdc++.h>
using namespace std;
int main() {
    int x, y, z;
    int cnt;
    while(cin >> x >> y >> z) {
        if(y < z) swap(y, z);
        if(x < y) swap(x, y);
        if(x <= y + z) {
            cnt = (x + y + z) / 20;
            cnt += (x + y + z) % 20 ? 1 : 0;
        } else {
            cnt = (y + z) / 10;
            x -= (y + z) / 10 * 10;
            int r = (y + z) % 10;
            if(r >= 8) {
                x -= r;
                cnt++;
            } else {
                x += r;
            }
            cnt += x / 15;
            cnt += x % 15 == 0 ? 0 : 1;
        }
        cout << cnt * 6 << endl;
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX