Advertisement
Onesible

The Hunting Games

Oct 22nd, 2023
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. days = int(input())
  2. number_players = int(input())
  3. energy = float(input())
  4. water_for_one = float(input())
  5. food_for_one = float(input())
  6. total_water = days * number_players * water_for_one
  7. total_food = days * number_players * food_for_one
  8. flag = False
  9. for day in range(1, days + 1):
  10.     energy_loss = float(input())
  11.     energy -= energy_loss
  12.     if energy <= 0:
  13.         flag = True
  14.         break
  15.     if day % 2 == 0:
  16.         energy = energy * 1.05
  17.         total_water *= 0.70
  18.     if day % 3 == 0:
  19.         total_food -= total_food / number_players
  20.         energy = energy * 1.1
  21.  
  22. if flag:
  23.     print(f"You will run out of energy. You will be left with {total_food:.2f} food and {total_water:.2f} water.")
  24. else:
  25.     print(f"You are ready for the quest. You will be left with - {energy:.2f} energy!")
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement