babavyna

Untitled

May 28th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. bottles = int(input())
  2.  
  3. total_detergent = bottles * 750
  4.  
  5. count= 0
  6. count_pot = 0
  7. count_dishes = 0
  8. while total_detergent >= 0:
  9. command = input()
  10. count += 1
  11. if command == 'End':
  12. break
  13. if count % 3 == 0:
  14. total_detergent -= int(command) * 15
  15. count_pot += int(command)
  16. else:
  17. total_detergent -= int(command) * 5
  18. count_dishes += int(command)
  19.  
  20.  
  21.  
  22. if total_detergent >= 0:
  23. print(f'Detergent was enough!')
  24. print(f'{count_dishes} dishes and {count_pot} pots were washed.')
  25. print(f'Leftover detergent {total_detergent} ml.')
  26. else:
  27. print(f'Not enough detergent, {abs(total_detergent)} ml. more necessary!')
Advertisement
Add Comment
Please, Sign In to add comment