View Code of Problem 88

#include<stdio.h>
int main()
{
	int a1,a2,a3,a4,a5,a6,sum,x,y;
	int s[4]={0,5,3,1};
	scanf("%d %d %d %d %d %d",&a1,&a2,&a3,&a4,&a5,&a6);
	sum=a6+a5+a4+(a3+3)/4;
	x=5*a4+s[a3%4];
	if(x<a2)
	{
		sum+=(a2-x+9-1)/9;
	}
	y=sum*36-a1*36-a5*25-a4*16-a3*9-a2*4;
	if(y<a1) 
	{
		sum+=(a1-y+35)/36;
	}
	printf("%d\n",sum);
	return 0;
}

Double click to view unformatted code.


Back to problem 88