Advertisement
Guest User

Untitled

a guest
Jun 8th, 2021
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.22 KB | None | 0 0
  1. a = input().split("#")
  2. water = int(input())
  3. b= " "
  4. effort = 0
  5. el = " "
  6. total_fire = 0
  7. el1 = 0
  8. firestop = []
  9. for i in range(len(a)):
  10.     if water <= 0:
  11.         break
  12.     if "High" or "Low" or "Medium" in a[i]:
  13.         el = a[i]
  14.         if "High" in el :
  15.             b = el.split()
  16.             el1 = int(b[2])
  17.             if el1 >= 81 and el1 <=125 and water >= el1:
  18.                 effort += el1 *0.25
  19.                 water -= el1
  20.                 total_fire += el1
  21.                 firestop.append(el1)
  22.         if "Medium" in el:
  23.             b = el.split()
  24.             el1 = int(b[2])
  25.             if el1>= 51 and el1 <=80 and water >= el1:
  26.                 effort += el1 * 0.25
  27.                 water -= el1
  28.                 total_fire += el1
  29.                 firestop.append(el1)
  30.         if "Low" in el:
  31.             b = el.split()
  32.             el1 = int(b[2])
  33.             if el1 >= 1 and el1 <= 50 and water >= el1:
  34.                 effort += el1 * 0.25
  35.                 water -= el1
  36.                 total_fire += el1
  37.                 firestop.append(el1)
  38.  
  39.  
  40. print(f"Cells:")
  41. for i in range(len(firestop)):
  42.     print(f" - {(firestop[i])}")
  43. print(f"Effort: {effort:.2f}")
  44. print(f"Total Fire: {int(total_fire)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement