hiho week 175 register

Ended

Participants:245

Verdict:Accepted
Score:100 / 100
Submitted:2017-11-11 13:32:11

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
31
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int x,y,z;
    cin >> x >> y >> z;
    vector<int> a={x,y,z};
    sort(a.begin(),a.end());
    x = a[2]; y = a[1]; z = a[0];
    if(x<=y+z) cout << (x+y+z+20-1)/20*6 << endl;
    else {
        int r = 0;
        int k = y+z;
        for(;k>=10;k-=10) {
            x -= 10;
            r += 1;
        }
        if(k<=8) {
            x -= 15-k;
            r ++;
        } else {
            x -= k;
            r ++;
        }
        if(x>0) {
            r += (x+15-1)/15;
        }
        cout << r * 6 << endl;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX