Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bottles = int(input())
- liquid = 750 * bottles
- is_enough = True
- counter = 0
- dishes = 0
- pots = 0
- command = input()
- while command != "End":
- count = int(command)
- counter += 1
- if counter % 3 == 0:
- liquid -= count * 15
- if liquid < 0:
- is_enough = False
- break
- elif liquid == 0:
- pots += count
- break
- else:
- pots += count
- command = input()
- else:
- liquid -= count * 5
- if liquid < 0:
- is_enough = False
- break
- elif liquid == 0:
- dishes += count
- break
- else:
- dishes += count
- command = input()
- if is_enough:
- print('Detergent was enough!')
- print(f'{dishes} dishes and {pots} pots were washed.')
- print(f'Leftover detergent {liquid} ml.')
- elif not is_enough:
- print(f'Not enough detergent, {abs(liquid)} ml. more necessary!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement