#include <iostream> using namespace std; int main() { int num, m, n, l, x, y, z;// m:1*1 n:2*2 l:3*3 x:4*4 y:5*5 z:6*6 int u[4] = {0, 5, 3, 1}; int left1; // 1*1 int left2; // 2*2 while(scanf("%d%d%d%d%d%d", &m, &n, &l, &x, &y, &z) && !(m==0&&n==0&&l==0&&x==0&&y==0&&z==0)) { num = x+y+z+(l+3)/4;//上取整 left2 = x*5 + u[l%4]; if(n > left2) num += (n - left2 + 8)/9; left1 = 36*num - 36*z - 25*y - 16*x - 9*l - 4*n;/*key point*/ if(m > left1) num += (m -left1 + 35)/36; printf("%d/n", num); } return 0; } //小结: 把握问题的症结,运用贪心的思想 //先处理2*2的物体,在处理1*1的物体