Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
count_bottles = int(input()) total_count_pots = 0 total_count_dishes = 0 count_loadings = 0 detergent_ml = count_bottles * 750 input_line = input() while input_line != "End": count_loadings += 1 if count_loadings % 3 == 0: count_pots = int(input_line) detergent_pots = count_pots * 15 detergent_ml -= detergent_pots total_count_pots += count_pots else: count_dishes = int(input_line) detergent_dishes = count_dishes * 5 detergent_ml -= detergent_dishes total_count_dishes += count_dishes if detergent_ml < 0: break input_line = input() if detergent_ml >= 0: print(f"Detergent was enough!") print(f"{total_count_dishes} dishes and {total_count_pots} pots were washed.") print(f"Leftover detergent {detergent_ml} ml.") else: print(f"Not enough detergent, {abs(detergent_ml)} ml. more necessary!")
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)