Solution:
The capacity of the tank is 60 units(LCM 12,30)

=>Efficiency of inlet pipe = 60/12 = 5hrs=>It can fill 5 units of the empty tank working alone in 1hr.

=>Efficiency of outlet pipe  = 60/30 = - 2  (negative sign because its an outlet pipe)

=>It can drain 2 units of the filled tank in 1 hrs alone

=>Working together, their efficiency is 5-2  =3 units/hr

=>Working together, they can fill 3 units of the empty tank in 1 hr

=>Working together, they can fill 60 units in 60/3 = 20 hrs (option c)