Solution:A can fill the tank = 12 minutesB can fill the tank = 16 minutes
Capacity of tan k = LCM of 12 and 16 = 48 (unit)

If tank is full in 9 minutes, then A will fill the tank for 9 minutes.
∴ In 9 minutes A will fill the tank = 9 × 4 = 36 unit
Remaining tank = 48 - 36 = 12 unit
These 12 units will fill B = 12/3 = 4 min.
So, after 4 minutes, B should be closed.