Pipes are connected to a tank or cistern and are used to fill or empty the tank. Inlet is a pipe connected with a tank or a cistern or a reservoir, that fills it. Outlet is a pipe connected with a tank or a cistern or a reservoir, emptying it.

Pipes and Cistern problems are similar to those on time and work. The only difference here is the work done is in terms of filling or emptying a cistern and the time taken is the time taken by a pipe or leak (crack) to fill or empty a cistern, respectively.

Generally, the time taken to fill a cistern is taken as positive and the time taken to empty a cistern is taken as negative. The amount of work done, i.e., filling or emptying a cistern is generally taken as unity, unless otherwise specified.

### General Rules

1. If an inlet can completely fill the empty tank in X hrs, the part of the tank filled in 1 hr = 1/X.

2. If an outlet can empty the full tank in Y hrs, the part of the tank emptied in 1 hr = 1/Y.

3. If both inlet and outlet are open, net part of the tank filled in 1 hr = 1/X - 1/Y.

4. If pipe A is ‘x’ times bigger than pipe B, then pipe A will take 1/xth (less time) of the time taken by pipe B to fill the cistern.

5. If an inlet pipe fills a cistern in a hours and takes x minutes longer to fill the cistern due to a leak in the cistern, then the time in which the leak will empty the cistern is given by a(1+a/x).

### Examples

Example 1: A tap can fill a cistern is 8 hrs and another can empty it in 16 hrs. If both the taps are opened simultaneously, find the time (in hrs) to fill the cistern?

The part of cistern filled in 1 hr = 1/8 - 1/16

= 1/16

∴ Total time taken to fill the cistern = 16 hrs

Example 2: Two pipes A and B can fill a cistern in 20 and 30 minutes, respectively. If both the pipes are opened simultaneously, how long will it take to fill the cistern?

Part of the cistern filed by pipe A alone in 1 minute = 1/20

Part of the cistern filled by pipe B in 1 hr = 1/30

∴ Part filled by (A + B) in 1 minute = 1/20 + 1/30 = 1/12

Therefore, both the pipes A and B together will fill the cistern in 12 minutes.

Example 3: Two taps A and B can fill a cistern in 30 minutes and 60 minutes, respectively. There is third exhaust tap C at the bottom of the tank. If all taps are opened at the same time, the cistern will be full in 45 minutes. In what time can exhaust tap C empty the cistern when full?

Let exhaust tap C can empty the cistern in k minutes.

Part of cistern filled in 1 minute = 1/30 + 1/60 - 1/k = 1/45

1/k = 1/30 + 1/60 - 1/45

1/k = 5/180

k = 36 minutes

Example 4: A leak in the bottom of a tank can empty the full tank in 6 hrs. An inlet pipe fills water at the rate of 4 litres per minute. When the tank is full, the inlet is opened and due to leak, the tank is empty in 8 hrs. Find the capacity of the tank.

Let the inlet alone takes k hours to fill the empty tank.

Part of tank emptied in 1 hour = 1/k - 1/6 = -1/8

1/k = 1/6 - 1/8

k = 24 hrs = 1440 minutes

In one minute, inlet pipe fills 4 liters

In 1440 minutes, 1440 × 4 = 5670 litres.

So, capacity of tank is 5670 litres.

Example 5: One fill pipe A is 4 times faster than second fill pipe B. If A can fill a cistern in 15 minutes, then find the time when the cistern will be full if both fill pipes are opened together?

Part of cistern filled by pipe A in 1 minute = 1/15

Part of cistern filled by pipe B in 1 minute = 1/60

When both pipes are opened, part of tank filled in 1 minute = 1/15 + 1/60 = 5/60 = 1/12

So, time when the cistern will be full if both fill pipes are opened together = 12 minutes.