View Code of Problem 88

#include<stdio.h>
void main() {
	int a,b,c,d,e,f;
	while(~scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)){
		int count=0,t1=0,t2=0;
		int temp[4]={0,5,3,1};
		count=f+e+d+(c+3)/4;
		t2=5*d+temp[c%4];
		t1=36*count-36*f-25*e-16*d-9*c-4*b;
		if(a>t1) 
			count+=(a-t1+35)/36;
		if(b>t2)	
			count+=(b-t2+8)/9;
		printf("%d\n",count);
	}
}

Double click to view unformatted code.


Back to problem 88