Pipe P can fill and empty tank in 4 hours but pipe Q can completely empty the same tank in 8 hours. But the pipes were opened alternately after every two hours starting with pipe P then in how many hours, the tank was completely filled ?