5 hours = 300 mins.

So each minute the inlet pipe will fill of the tank and the outlet pipe will empty of the tank.

Put them together, you get every minute

of the tank will be filled.

.

So every minute, of the tank will be filled.

So you would need 1200 minutes to fill the tank, or 20 hours.

Of course, no-one would fill a tank this way... it's too wasteful.