Saturday, December 3, 2016

Codeforce - B. Anton and Digits

/*                          CODEMAN
                        Arif Khan Nihar
                    Problem -B. Anton and Digits
*/
#include<bits/stdc++.h>
#define long long ll
//#define long int li
using namespace std;

int main()
{
    string s;
    int d2,d3,d5,d6,mi = 5000001,mi2=5000001,sum=0;
    cin>>d2>>d3>>d5>>d6;
     mi = min(d2,min(d5,d6));
     sum += 256*mi;
     d2 -= mi , d5 -= mi, d6 -= mi;
     if(d2 != 0 and d3 != 0){
        mi2 = min(d2,d3);
        sum += 32*mi2;
     }
        cout<<sum<<endl;

    return 0;
}

No comments: