#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iostream>
#include<time.h>
using namespace std;
int main()
{
int value[7];
int key[4] = { 0, 5, 3, 1 };
while (1)
{
int temp=0;
for (int i = 1; i<7; i++)
{
cin >> value[i];
temp+= value[i];
}
if (temp == 0)
{
return 0;
}
int sum = 0;
sum = value[6] + value[5] + value[4] + (value[3] + 3) / 4;
int a2 = value[4] * 5 + key[value[3] % 4];
if (value[2]>a2)
sum += (value[2] - a2 + 8) / 9;
int a1 = sum * 36 - value[6] * 36 - value[5] * 25 - value[4] * 16 - value[3] * 9 - value[2] * 4;
if (value[1]>a1)
sum += (value[1] - a1 + 35) / 36;
cout << sum << endl;
}
return 0;
}
POJ 1017(贪心)
最新推荐文章于 2018-12-13 23:42:37 发布