using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Yukicoder { class Program { static void Main(string[] args) { var line = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); var right = line.Max(); var left = line.Min(); while (right - left > 1) { var mid = (right + left)/2; var sum = 0; for (int i = 0; i < line.Length; i++) { if (line[i] >= mid) { sum += (line[i] - mid)/2; } else { sum -= mid - line[i]; } } if (sum >= 0) { left = mid; } else { right = mid; } } Console.WriteLine(left); } } }