Advertisement
bl00dt3ars

01. Pipes In Pool

Oct 25th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. V = int(input())
  2. P1 = int(input())
  3. P2 = int(input())
  4. H = float(input())
  5.  
  6. p1_liters = P1 * H
  7. p2_liters = P2 * H
  8. total_liters = p1_liters + p2_liters
  9. if total_liters > V:
  10.     print(f"For {H:.2f} hours the pool overflows with {total_liters - V:.2f} liters.")
  11. else:
  12.     print(f"The pool is {total_liters / V * 100:.2f}% full. Pipe 1: {p1_liters / total_liters * 100:.2f}%. Pipe 2: {p2_liters / total_liters * 100:.2f}%.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement