let's say the pipes are "a", to drain it in 6hours, "b" to fill it up by itself in 4hours and "c" to fill it up in 5 hours.
so..."a" can drain it in 6hours, that means, in 1 hour, "a" has only done 1/6 of the job, because in 6 hours, it would have done 6/6 or 1 whole, the whole job, the cistern fully filled up, but, in 1 hour, it has only done 1/6 of that.
"b" in 1 hour, has only done 1/4 of the whole job then.
"c" in 1 hour has only done 1/5 of the whole job then.
now... let's say it took "x" hours, if we have "a", "b" and "c" running,
a draining away whilst
b and
c filling it up.
since it takes "x" hours to fill the cistern, after 1 hour, all three have only done 1/x of the whole job.
well, let's add their rates, to see what we get then.

how long does it take to fill the cistern? well, just solve for "x".