Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import floor
- from math import ceil
- x_square_meters_grapes = int(input())
- y_kg_grape_for_square_meter = float(input())
- z_needed_liters_wine = int(input())
- number_workers = int(input())
- grape_amount = x_square_meters_grapes * y_kg_grape_for_square_meter
- wine_amount = ((0.4 * grape_amount) / 2.5)
- diff = abs(wine_amount - z_needed_liters_wine)
- if wine_amount >= z_needed_liters_wine:
- diff = ceil(diff)
- wine_worker = ceil(diff // number_workers)
- rounded_wine_amount = floor(wine_amount)
- print(f"Good harvest this year! Total wine: {rounded_wine_amount} liters.")
- print(f"{diff} liters left -> {wine_worker} liters per person.")
- else:
- diff = floor(diff)
- print(f"It will be a tough winter! More {diff} liters wine needed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement