How long will it take to fill this cistern?

Pipes $A$ and $B$ call fill a cistern in $20$ and $30$ minutes and C can empty it in $15$ minutes. If the three are opened and closed after the other successively for $1$ min each in that order, how soon will the cistern be filled?

So from this we can say that part filled in $3$ min $= \frac 1 {20} +\frac 1{30}-\frac 1{15} = \frac {1}{60}$th

But now how to form the rest of the solution, any ideas?

-
The correct answer is 167 minutes. –  Quixotic Sep 1 '12 at 10:16
... a paradox ... :(( –  Santosh Linkha Sep 1 '12 at 10:17
The classic problem is an animal climbing out of a well. It climbs a certain amount each day and slips back some each night. The idea is the same: if you just take the difference and divide the height by that, you lose the fact that it first reaches the top at the end of a day. –  Ross Millikan Sep 1 '12 at 14:36

Since you add $\frac{1}{20}+\frac{1}{30}$ before subtracting $\frac{1}{15}$, it is sensible to see how long it takes to fill $1-\frac{1}{20}-\frac{1}{30}$ of the tank using the three steps.

This is $\frac{11}{12}=\frac{55}{60}$ of the tank and so takes $55 \times 3 = 165$ minutes.

You then add $\frac{1}{20}$ in the $166$th minute and $\frac{1}{30}$ in the $167$th minute to reach a full tank, so the answer is $167$ minutes.

-

Not sure if you're looking for a hint or a solution here. In any case, you already know that after every complete 3 minute cycle, the cistern will be another $\frac1{60}$ full. During each cycle, the cistern is at it's fullest just before pipe C opens to empty it. This partial cycle yields $\frac3{60}$ from pipe A, then another $\frac2{60}$ from pipe B.

Can you finish it from here?

-
Sorry, not clear. –  Quixotic Sep 1 '12 at 10:33

woops!! ...
Tank is full at $180$ minutes after $1/15$th part is drained by last minute. If we look oppositely, $1$ (or full tank) in $180$ the minute, $1+1/15$ in $179$, $1+1/15 - 1/30$ in $178$, $1+1/15 - 1/30-1/20$ in $177$ ..

If we look oppositely it is essentially the time required to build up extra $1/15$ th in $179$the minute volume and drain it in the last. The filling up equation from opposite will be of the following form. So we are trying to find the least positive integer solution of one of these equations. $${n \over 15} - {n \over 30} - {n \over 20} = -{1 \over 15} \\ {n +1\over 15} - {n \over 30} - {n \over 20} = -{1 \over 15}\\ {n +1\over 15} - {n+1 \over 30} - {n \over 20} = -{1 \over 15}$$ So we have $n = 4$ for the first equaton so $4 + 4 + 4 = 12$, (from opposite view) it takes $12$ minute to build up $1 /15$ th volume and another min to drain it. So, $180 - 13 = 167$.

-