A water tank is two-fifth full. Pipe A can fill the tank in 10 minutes, and pipe B can empty it in 6 minutes. If both pipes are open, how long will it take to empty or fill the tank completely?

a) 24 minutes to empty
b) 24 minutes to fill
c) 30 minutes to empty
d) 30 minutes to fill