Advertisement
Guest User

Untitled

a guest
Jul 28th, 2021
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. fires_cells = input().split("#")
  2. water = int(input())
  3. effort = 0
  4. total_fire = []
  5. for i in range(len(fires_cells)):
  6.     level, cell = fires_cells[i].split(" = ")
  7.     cell = int(cell)
  8.     if level == "Low" and not 1 <= cell <= 50:#if level == "Low" and cell > 50:
  9.         continue
  10.     if level == "Medium" and not 51 <= cell <= 80:
  11.         continue
  12.     if level == "High" and not 81 <= cell <= 125:
  13.         continue
  14.     if water < cell:
  15.         continue
  16.     water -= cell
  17.     total_fire.append(cell)
  18.     effort += cell * 0.25
  19. print("Cells:")
  20. for el in total_fire:
  21.     print(f" - {str(el)}")
  22. print(f"Effort: {effort:.2f}")
  23. print(f"Total Fire: {str(sum(total_fire))}")
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement