Advertisement
GeorgiLukanov87

gold_mine-06-100/100

Apr 16th, 2022
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. count_locations = int(input())
  2. for location in range(1, count_locations+1):
  3.     total_gold = 0
  4.     expected_gold = float(input())
  5.     count_days = int(input())
  6.     for day in range(1, count_days+1):
  7.         current_gold = float(input())
  8.         total_gold += current_gold
  9.     total_gold_per_day = total_gold / count_days
  10.     if total_gold_per_day >= expected_gold:
  11.         print(f"Good job! Average gold per day: {total_gold_per_day:.2f}.")
  12.     else:
  13.         print(f"You need {abs(expected_gold-total_gold_per_day):.2f} gold.")
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement