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