Three pipes are connected to a water tank. One of the pipes can fill the tank in 30 minutes. The second pipe can fill it in 20 minutes. The third pipe can fill the tank in 10 minutes. How long will it take to fill the tank if all three pipes are opened together? If the slowest pipe is shut off after 3 minutes and the fastest pipe is shut off 3 minutes later, how long will it take the remaining open pipe to finish filling the lank?