using System; using System.Linq; class Program { static void Main(string[] args) { string s1 = Console.ReadLine(); string s2 = Console.ReadLine(); int output; int[] array1 = s1.Split(' ').Select(a => int.Parse(a)).ToArray(); int[] array2 = s2.Split(' ').Select(a => int.Parse(a)).ToArray(); if (array1[0] * array1[1] - array2.Sum() > 0) { output = array1[0] * array1[1] - array2.Sum(); } else { output = -1; } Console.WriteLine(output); } }