View Code of Problem 88

#include <stdio.h>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	scanf("%d%d%d%d%d%d", &a, &b,&c,&d,&e,&f);
	int cnt = 0;
	int x,y; //x is 1x1 y is 2x2
	int extrathree[4] = {0,5,3,1};
	cnt = f+e+d+(c+3)/4; //(c+3)/4 up to get int
	y = d*5 + extrathree[c%4];
	if( b>y ){
		cnt += (b-y+8)/9; //up to get int
	}
	x = 36*cnt-f*36-e*25 - d*16-c*9-b*2;
	if( a>x ){
		cnt += (a-x+35)/36;
	}
	printf("%d", cnt );
	return 0;
	
}

Double click to view unformatted code.


Back to problem 88