bl00dt3ars

01. Dishwasher

Oct 18th, 2020 (edited)
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. bottles = int(input()) * 750
  2. line_counter = 0
  3. plates = 0
  4. pots = 0
  5.  
  6. line = input()
  7. while line != "End" and bottles >= 0:
  8.     dishes = int(line)
  9.     line_counter += 1
  10.     if line_counter % 3 == 0:
  11.         pots += dishes
  12.         bottles -= 15 * dishes
  13.     else:
  14.         plates += dishes
  15.         bottles -= 5 * dishes
  16.     if bottles < 0:
  17.         break
  18.     line = input()
  19.  
  20. if bottles < 0:
  21.     print(f"Not enough detergent, {abs(bottles)} ml. more necessary!")
  22. else:
  23.     print("Detergent was enough!")
  24.     print(f"{plates} dishes and {pots} pots were washed.")
  25.     print(f"Leftover detergent {bottles} ml.")
Add Comment
Please, Sign In to add comment