Sichanov

goldmine

Dec 14th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. number_of_locations = int(input())
  2. for location in range(number_of_locations):
  3.     expected_average_income = float(input())
  4.     days_for_current_location = int(input())
  5.     current_income = 0
  6.     for days in range(days_for_current_location):
  7.         daily_income = float(input())
  8.         current_income += daily_income
  9.     real_average_income = current_income / days_for_current_location
  10.     if real_average_income >= expected_average_income:
  11.         print(f"Good job! Average gold per day: {real_average_income:.2f}.")
  12.     else:
  13.         final_result = expected_average_income - real_average_income
  14.         print(f"You need {final_result:.2f} gold.")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment