Advertisement
Spocoman

Gold Mine

Jan 6th, 2022 (edited)
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. locations = int(input())
  2. for i in range(locations):
  3.     target = float(input())
  4.     mining_day = int(input())
  5.     gold_sum = 0
  6.     for j in range(mining_day):
  7.         gold_sum += float(input())
  8.    
  9.     if (gold_sum / mining_day) >= target:
  10.         print(f"Good job! Average gold per day: {gold_sum / mining_day:.2f}.")
  11.     else:
  12.         print(f"You need {target - (gold_sum / mining_day):.2f} gold.")
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement