View Code of Problem 88

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

Double click to view unformatted code.


Back to problem 88