Skip to content

Instantly share code, notes, and snippets.

@monchy-monchy
Created July 22, 2021 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monchy-monchy/ba5d40fc312d7663a6266bbfd7c0116b to your computer and use it in GitHub Desktop.
Save monchy-monchy/ba5d40fc312d7663a6266bbfd7c0116b to your computer and use it in GitHub Desktop.
ABC151 B - Achieve the Goal
N, K, M = list(map(int, input().split()))
A = list(map(int, input().split()))
X = M*N -sum(A)
if X <= K:
if X >= 0:
print(X)
else:
print(0)
else:
print(-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment