Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a_bottle = 750 # 750 ml # 2 Зареждания с чинии и 1 зареждане с тенджери
- check_plates = 2
- count_plates = 0
- count_pots = 0
- count_bottles = int(input())
- open_detergent = count_bottles * a_bottle
- left_detergent = open_detergent
- while True:
- count_units = input()
- if count_units == 'End':
- break
- count_units = int(count_units)
- if check_plates > 0:
- count_plates = count_plates + count_units
- check_plates -= 1
- left_detergent = left_detergent - (5 * count_units)
- if left_detergent < 0:
- break
- else:
- count_pots = count_pots + count_units
- left_detergent = left_detergent - (15 * count_units)
- check_plates = 2
- if left_detergent < 0:
- break
- balance = abs(left_detergent)
- if left_detergent >= 0:
- print('Detergent was enough!')
- print(f'{count_plates} dishes and {count_pots} pots were washed.')
- print(f'Leftover detergent {left_detergent} ml.')
- else:
- print(f'Not enough detergent, {balance} ml. more necessary!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement