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 = int.Parse(line[1]); line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, int.Parse); getAns(n, X, a); } static void getAns(int n, int X, int[] a) { var asum = a.Sum(); foreach (var x in a) { if (x % 2 == 0) { var w = asum - x / 2; if (w % (n - 1) == 0 && w / (n - 1) == X) { Console.WriteLine(x / 2); return; } } } } }