using System; using System.Linq; public class Hello{ public static void Main(){ int[] input1 = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); int[] input2 = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); int beans = input1[0] * input1[1]; for(int i = 0; i < input2.Length; i++) { beans = beans - input2[i]; } if(beans < 0) { beans = -1; } Console.WriteLine(beans < 0 ? -1 : beans); } }