Concept: the root concept of pipes and cistern as same as time and work.
The inlet pipe is considered as positive work and leak or exit pipe is considered as negative work.
1) If a pipe can fill a tank in x hours, part filled in 1 hour =
2) If a pipe can empty the tank in y hours, part emptied in 1 hour =
3) If a pipe can fill a tank in x hours and due to a leak at the bottom of the tank it gets emptied in y hours.
So they together can fill the tank In hours.
4) If two pipes separately can fill a tank in x hours and y hours respectively, then together they can fill the tank in hours.