View Code of Problem 88

#include<stdio.h>
int main()
{
	int a,b,c,d,e,f,g;
	int s[]={0,5,3,1},sum;
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
	sum=f+e+d+(c+3)/4;
	int y;
	y=5*d+s[c%4];
	if(b>y)
	sum+=(b-y+8)/9;
	int x;
	x=36*sum-36*f-25*e-9*d-4*b;
	if(a>x)
	sum+=(a-x+35)/36;
	printf("%d\n",sum);
}

Double click to view unformatted code.


Back to problem 88