http://codeforces.com/problemset/problem/478/C
水。
#include<stdio.h> int main() { long long a,b,c,temp; scanf("%lld%lld%lld",&a,&b,&c); long long sum; if(a>=b && a>=c) { sum = b+c; temp = a; } else if(b>=a && b>=c) { sum = a+c; temp = b; } else { sum = a+b; temp = c; } if(sum <= temp/2) { printf("%lld ",sum); } else { printf("%lld ",(sum+temp)/3); } }