Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import trunc
- v = int(input())
- p1 = int(input())
- p2 = int(input())
- h = float(input())
- litres = (p1 + p2) * h
- if litres > v:
- overfilled = litres - v
- print(f'For {h} hours the pool overflows with {overfilled} liters.')
- else:
- filled = trunc((litres / v) * 100)
- percentp1 = trunc((p1 * h) / litres * 100)
- percentp2 = trunc((p2 * h) / litres * 100)
- print(f'The pool is {filled:.2f}% full. Pipe 1: {percentp1:.2f}%. Pipe 2: {percentp2:.2f}%.')
Advertisement
Add Comment
Please, Sign In to add comment