using System.Linq; using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var X = long.Parse(line[1]); line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, long.Parse); getAns(n, X, a); } static void getAns(int n, long X, long[] a) { X *= n - 1; var asum = a.Sum(); foreach (var x in a) { if (x % 2 == 0 && asum - x / 2 == X) { Console.WriteLine(x / 2); return; } } } }