分类就可以了
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
while(scanf("%d%d%d", &a, &b, &c), !(0 == a && 0 == b && 0 == c)) {
int i, j, sum;
sum = 0;
if(a >= 2 && b >= 1 || (a >= 4) || (a >= 1 && b >= 2) || (0 == b && a >= 4)) {
sum = a + 2*b + 5*c;
printf("%d\n", sum+1);
continue;
}
else if(0 == a) {
printf("1\n");
continue;
}
else if(1 == a && 1 == b) {
printf("4\n");
continue;
}
if(0 == b && a < 4) {
printf("%d", a+1);
continue;
}
}
return 0;
}