Advertisement
nq1s788

1b

Feb 28th, 2024
612
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. k, n, w = map(int, input().split())
  2. sm = 0 #суммарная стоимость бананов
  3. for i in range(1, w + 1):
  4.     sm += i * k
  5. if sm > n:
  6.     print(sm - n)
  7. else:
  8.     print(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement