Let the torture tank containg gallons.

By the conditions the inlet takes 2 hours. That means the rate is .

The outlet takes 5 hours. That means the rate is

The tank is half full it has . The net gain from the two pipes is

gallons per hour.

Thus, the question is how long does it take for the net chain to reach gallons?

The answer is, hours.

Combine the denominator,

Divide fractions,

hours. Which is 1 hour and 40 minutes.