#include #define rep(i,n) for(int i = 0; i < n; i++) #define rep1(i,n) for(int i = 1; i <= n; i++) #define co(x) cout << x <> x >> y >> z; int d = abs(x - y); int ans; if (d >= z)ans = min(x + z, y + z); else { z -= d; ans = max(x, y) + z / 2; } co(ans); return 0; }