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