Explanation:
20 men work 8 hours a day for 18 days.
that are
20×8×18 = 2880 work hours to complete that work.
if 24 men work 5 hours a day, that are
24×5 = 120 work hours per day.
we still need to do the total 2880 work hours.
so, they will need
2880 / 120 = 24 days to complete the work.