We can extend the result to cover three pipes. Only thing we have to keep in mind is that P3 drains the tank and we have to use negative sign for this.
If t is the time taken to fill up the tank when all the three pipes are open, then
1t=13+15−14=20+12−1560=1760.
Hence, t=6017. Hence it takes 3917 hours to fill up the tank.