#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
int a[10], ans, i;
while (~scanf("%d", &a[1]))
{
for (i = 2; i <= 6; i++)
scanf("%d", &a[i]);
for (i = 1; i <= 6; i++)
if (a[i]) break;
if (i > 6) break;
ans = a[6] + a[5] + a[4] + a[3] / 4;
a[3] = a[3] % 4;
a[1] = max(0, a[1] - 11 * a[5]);
if (a[2] >= a[4] * 5) a[2] = a[2] - a[4] * 5;
else
{
a[1] = max(0, a[1] - 4 * (a[4] * 5 - a[2]));
a[2] = 0;
}
if (a[3] == 3)
{
ans++;
a[1] = max(a[1] - 5, 0);
if (a[2] >= 1) a[2] -= 1;
else
{
a[1] = max(a[1] - 4, 0);
}
}
else if (a[3] == 2)
{
ans++;
a[1] = max(a[1] - 6, 0);
if (a[2] >= 3) a[2] -= 3;
else
{
a[1] = max( a[1] - (3 - a[2]) * 4, 0);
a[2] = 0;
}
}
else if (a[3] == 1)
{
ans++;
a[1] = max(a[1] - 7, 0);
if (a[2] >= 5) a[2] = a[2] - 5;
else
{
a[1] = max(0, a[1] - 4 * (5 - a[2]));
a[2] = 0;
}
}
ans += (a[1] + 4 * a[2] + 35) / 36;
printf("%d
", ans);
}
return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。http://xiang578.top/