Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fires = input().split('#')
- water = int(input())
- effort = 0
- total_fire = 0
- for item in range(len(fires)):
- fire = fires[item].split(' = ')
- valid ={'Low': 1 <= int(fire[1]) <= 50,
- 'Medium': 51 <= int(fire[1]) <= 80,
- 'High': 81 <= int(fire[1]) <= 125 }
- if valid[fire[0]] and water >= int(fire[1]):
- effort += int(fire[1]) / 4
- total_fire += int(fire[1])
- fires[item] = int(fire[1])
- water -= int(fire[1])
- else:
- fires[item] = ''
- fires = list(filter(lambda a: a != '', fires))
- print('Cells:')
- for fire in fires:
- print(f' - {fire}')
- print(f'Effort: {effort:.2f}\nTotal Fire: {total_fire}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement