SaveText.Ru

Без имени
  1. nums = input().split()
  2.  
  3. banana_price = int(nums[0])
  4. money = int(nums[1])
  5. bananas_count = int(nums[2])
  6.  
  7. need_money = 0
  8.  
  9. for i in range(bananas_count + 1):
  10.     need_money += i * banana_price
  11.    
  12. if money - need_money > 0:
  13.     print(0)
  14. else:
  15.     print(need_money - money)
  16.    

Share with your friends:

Print