Sichanov

gold_mine

Apr 26th, 2021
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. number_of_locations = int(input())
  2.  
  3. for each_location in range(number_of_locations):
  4.     expected_average_gold_per_day = float(input())
  5.     days_of_work = int(input())
  6.     total_gold_for_each_location = 0
  7.     for each_day in range(days_of_work):
  8.         daily_gold = float(input())
  9.         total_gold_for_each_location += daily_gold
  10.     average_gold_per_location = total_gold_for_each_location / days_of_work
  11.     if average_gold_per_location >= expected_average_gold_per_day:
  12.         print(f"Good job! Average gold per day: {average_gold_per_location:.2f}.")
  13.     else:
  14.         print(f"You need {expected_average_gold_per_day - average_gold_per_location:.2f} gold.")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment