DiYane

Snowballss

Jul 28th, 2023 (edited)
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. def calculate_snowball_value(weight, time, quality):
  2.     return (weight / time) ** quality
  3.  
  4. N = int(input())
  5. highest_value = 0
  6. best_snowball = None
  7.  
  8. for _ in range(N):
  9.     weight = int(input())
  10.     time = int(input())
  11.     quality = int(input())
  12.  
  13.     snowball_value = calculate_snowball_value(weight, time, quality)
  14.  
  15.     if snowball_value > highest_value:
  16.         highest_value = snowball_value
  17.         best_snowball = (weight, time, quality)
  18.  
  19. snowball_weight, snowball_time, snowball_quality = best_snowball
  20. print(f"{snowball_weight} : {snowball_time} = {int(highest_value)} ({snowball_quality})")
  21.  
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment