Question: a can do piece of work in 40 days?
Answer: X can DO the work in 40 days. He works at it for 8 days and that means he's finished fifth of the work (1/5). Now Y took 16 days to finish the rest of the work, which means he finished 4/5 th of the work in 16 days and will take 16 * 5/4 = 20 days to finish the work on a whole.