常ズレ草

なんでも屋。備忘録のため読ませる気ゼロ。

No.143 豆 (yukicoder,python)

最近[int(i) for i in input().split()]ばっかり使ってる

#説明不要!!

grain,bag,family=[int(i) for i in input().split()]
age_list = [int(i) for i in input().split()]

sum_eat = sum(age_list)
sum_grain = grain * bag

if sum_grain >= sum_eat:
    print(sum_grain - sum_eat)
    
else:
    print(-1)