Advertisement
Andonoff

08. Seize the Fire

Jun 1st, 2025
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. input_list = input().split("#")
  2. water_amount = int(input())
  3. effort = 0
  4. fire_and_cells = []
  5. cells_putout = []
  6. options = ["High", "Medium", "Low"]
  7.  
  8.  
  9. for fc in range(len(input_list)):
  10.     fire_and_cells.append(input_list[fc].split(" = "))
  11.  
  12. for f_and_c in fire_and_cells:
  13.     if (f_and_c[0] == "Low" and 1 <= int(f_and_c[1]) <= 50) or \
  14.         (f_and_c[0] == "Medium" and 51 <= int(f_and_c[1]) <= 80) or \
  15.         (f_and_c[0] == "High" and 81 <= int(f_and_c[1]) <= 125):
  16.             if int(f_and_c[1]) < water_amount:
  17.                 water_amount -= int(f_and_c[1])
  18.                 effort += int(f_and_c[1]) * 0.25
  19.                 cells_putout.append(int(f_and_c[1]))
  20.  
  21. print("Cells:")
  22. for cell in cells_putout:
  23.     print(f" - {cell}")
  24. print(f"Effort: {effort:.2f}")
  25. print(f"Total Fire: {sum(cells_putout)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement