Advertisement
Guest User

Untitled

a guest
Jul 7th, 2020
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. count_bottles = int(input())
  2. count_dishes = input()
  3. plates = 0
  4. pots = 0
  5. counter = 1
  6. total_detergent = 750 * count_bottles
  7. used_detergent_for_plates = 0
  8. used_detergent_for_pots = 0
  9. used_detergent = 0
  10. count_plates = 0
  11. count_pots = 0
  12.  
  13. while count_dishes != 'End':
  14. dishes = int(count_dishes)
  15. if counter % 3 == 0:
  16. used_detergent_for_pots = dishes * 15
  17. total_detergent -= used_detergent_for_pots
  18. count_pots += dishes
  19. used_detergent = used_detergent_for_pots
  20. else:
  21. used_detergent_for_plates = dishes * 5
  22. total_detergent -= used_detergent_for_plates
  23. count_plates += dishes
  24. used_detergent = used_detergent_for_plates
  25. if total_detergent < 0:
  26. print(f"Not enough detergent, {abs(total_detergent)} ml. more necessary!")
  27.  
  28. counter += 1
  29. count_dishes = input()
  30.  
  31.  
  32. print("Detergent was enough!")
  33. print(f"{count_plates} dishes and {count_pots} pots were washed.")
  34. print(f"Leftover detergent {total_detergent} ml.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement