let inpA = readLine()! let inpB = readLine()! let inpAs = inpA.split(separator: " ").map{Int($0)!} let ages = inpB.split(separator: " ").map{Int($0)!}.reduce(0, +) let beans = inpAs[0] * inpAs[1] let rem = beans - ages print(rem > 0 ? rem : -1)