View Code of Problem 88

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int x1,x2,x3,x4,x5,x6;
    int b[4]={0,5,3,1};
    int b1,b2;
    int sum = 0;
    cin>>x1>>x2>>x3>>x4>>x5>>x6;
    sum = x6 + x5 + x4 + (x3+3) / 4;
    b2 = b[x3 %  4] + 5*x4 ;
    if(x2 > b2)
        sum += (x2 - b2 + 8)/9;
    b1 = sum*36 -36*x6 - 25*x5 - 16*x4 - 9*x3 - 4*x2;
    if(x1 > b1)
        sum += (x1 - b1 + 35)/36;
    cout << sum;
}

Double click to view unformatted code.


Back to problem 88