Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HIGH_RANGE = range(81, 126)
- MID_RANGE = range(51, 81)
- LOW_RANGE = range(1, 51)
- fire_data = input().split('#')
- total_water = int(input())
- fire_cells = []
- for every_fire in fire_data:
- fire_range, fire_value = every_fire.split(' = ')
- fire_value = int(fire_value)
- if fire_value > total_water:
- continue
- if fire_range == 'High' and fire_value not in HIGH_RANGE:
- continue
- elif fire_range == 'Medium' and fire_value not in MID_RANGE:
- continue
- elif fire_range == 'Low' and fire_value not in LOW_RANGE:
- continue
- total_water -= fire_value
- fire_cells.append(fire_value)
- print("Cells:")
- for cell in fire_cells:
- print(f" - {cell}")
- effort = sum(fire_cells) * 0.25
- print(f'Effort: {effort:.2f}')
- total_fire = sum(fire_cells)
- print(f"Total Fire: {total_fire}")
Add Comment
Please, Sign In to add comment