using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var line = Console.ReadLine().Split(' '); var n = int.Parse(line[0]); var x = int.Parse(line[1]); var a = Console.ReadLine().Split(' ').Select(value => int.Parse(value)).ToArray(); var sum = 0; Array.Sort(a); for(var i = 0; i < n; i++) { for(var j = n - 1; j >= 0; j--) { if (a[i] + a[j] == x) { sum++; } else if (a[i] + a[j] < x) { break; } } } Console.WriteLine(sum); } } }