#include #include #include #include #include #include #include #include using namespace std; /* cin.ignore(); getline(cin,dataStr); data = new int[n]; stringToInteger(&dataStr,data,n); */ void stringToInteger(string *str,int *data,int n){ for(int i=0;ifind(' ',0); data[i] = atoi(str->substr(0,spaceN).c_str()); str->erase(0,spaceN+1); } } void swap(int *a,int *b){ int tmp = *a; *a = *b; *b = tmp; } void babbleSort(int *data,int n){ for(int i=0;ii;j--){ if(data[j]>=data[j-1]){ swap(&data[j],&data[j-1]); } } } } int main(){ int data[3]; cin>>data[0]>>data[1]>>data[2]; //0:biggest 2:smallest babbleSort(data,3); int tmp = data[1]-data[2]; if(data[0] - tmp*2 >= data[2]){ data[0] -= tmp*2; data[2] += tmp; int tmp2 = (data[0]-data[2])/10; data[0] -= tmp2*8; data[1] += tmp2*2; data[2] += tmp2*2; } else{ tmp = data[0] - data[1]; if(tmp%2 ==0){ data[0] -= tmp; data[2] += tmp/2; } else{ data[0] -= (tmp-1); data[2] += (tmp+1)/2; } int tmp2 = (data[0] - data[2])/4; data[0] -= tmp2*2; data[1] -= tmp2*2; data[2] += tmp2*2; /* if(data[1]