Sichanov

the_hunting_games

Oct 24th, 2021
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. days = int(input())
  2. players = int(input())
  3. energy = float(input())
  4. water_per_day = float(input())
  5. food_per_day = float(input())
  6. total_water = players * water_per_day * days
  7. total_food = players * food_per_day * days
  8. no_energy = False
  9.  
  10. for each_day in range(1, days + 1):
  11.     lost_energy = float(input())
  12.     energy -= lost_energy
  13.     if each_day % 2 == 0:
  14.         energy += energy * 0.05
  15.         total_water -= total_water * 0.3
  16.     if each_day % 3 == 0:
  17.         total_food -= total_food / players
  18.         energy *= 1.10
  19.  
  20.     if energy <= 0:
  21.         no_energy = True
  22.         break
  23.  
  24. if no_energy:
  25.     print(f'You will run out of energy. You will be left with {total_food:.2f} food and {total_water:.2f} water.')
  26. else:
  27.     print(f'You are ready for the quest. You will be left with - {energy:.2f} energy!')
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment