View Code of Problem 88

#include<iostream>
#include<math.h>
using namespace std;
int main(){
	int a1,b2,c3,d4,e5,f6;
	int bb2,aa1;
	while(cin>>a1>>b2>>c3>>d4>>e5>>f6){
	int sum=0;
	sum=((d4+e5+f6)+ceil(1.0*c3/4));
	//cout<<sum<<endl;
	int us[4]={0,5,3,1};
	bb2=5*e5+us[c3%4];
	if(b2>bb2){
		sum+=ceil(1.0*(b2-bb2)/9);
	}
	aa1=36*sum-36*f6-25*e5-16*d4-9*c3-4*b2;
	if(a1>aa1){
		sum+=ceil(1.0*(a1-aa1)/36);
	}
	cout<<sum<<endl;
}
}

Double click to view unformatted code.


Back to problem 88