Advertisement
usmiwka80

8. * Seize the Fire

Aug 31st, 2024
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | Software | 0 0
  1. list_cells = input().split("#")
  2. quantity_water = int(input())
  3. type_fire = ""
  4. High = 0
  5. Medium = 0
  6. Low = 0
  7. effort = 0
  8. print("Cells:")
  9. total_fire = 0
  10. for cells in range(len(list_cells)):
  11.     type_fire = list_cells[cells]
  12.     type_fire, value = type_fire.split(" =")
  13.     value = int(value)
  14.     if type_fire == "High":
  15.         High = value
  16.         if 81 <= High <= 125 and quantity_water - High > 0:
  17.             quantity_water = quantity_water - High
  18.             effort += 0.25 * High
  19.             total_fire += High
  20.             print(f"- {High}")
  21.     elif type_fire == "Medium":
  22.         Medium = value
  23.         if 51 <= Medium <= 80 and quantity_water - Medium > 0:
  24.             quantity_water = quantity_water - Medium
  25.             effort += 0.25 * Medium
  26.             total_fire += Medium
  27.             print(f"- {Medium}")
  28.     else:
  29.         Low = value
  30.         if 1 <= Low <= 50 and quantity_water - Low > 0:
  31.             quantity_water = quantity_water - Low
  32.             effort += 0.25 * Low
  33.             total_fire += Low
  34.             print(f" - {Low}")
  35. print(f"Effort: {effort:.2f}")
  36. print(f"Total Fire: {total_fire}")
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement