Pipe A fill tank in --->>>10 minutes
Pipe B fill tank in--->>>20 minutes
Target --->>> We have to fill the tank in 8 minutes
Given --->>> A is open for 8 minutes and B is closed after some time lets assume it 'x'
so A fill one tank in --->>>10 minutes
so in 1 minute it will fill --->>>1/10 part of tank
so in 8 minute it will fill --->>>8/10 part of tank
B fill one tank in --->>>20 minutes
so in 1 minute it will fill --->>> 1/20 part of tank
so in x minute it will fill--->>> x/20 part of tank
its given that in 8 minutes the tank is full so ultimately
x/20 + 8/10 =1
so x=4 minutes