#include <stdio.h> #include <iostream> #include <string.h> #include <string> #include <algorithm> #include <iomanip> using namespace std; int main() { int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; int sum = f + e + d + (c + 3) / 4; int g[4] = { 0,5,3,1 }; int n2 = d * 5 + g[(c % 4)]; if (b > n2) { sum += (b - n2 + 8) / 9; } int n1 = 36 * (sum - f) - 25 * e - 16 * d - 9 * c - 4 * b; if (a > n1) { sum += (a - n1 + 35) / 36; } cout << sum; return 0; } |
Double click to view unformatted code.