Let N men were employed at first
∵ N men do 1/2 of the work in 24 days
∴ 1 man do the whole work in 24 x 2 x N = 48N days
Now, from the question,
(N + 16) men do the remaining work (1 - 1/2) = 1/2 in (40 - 24) = 16 days
∴ 1 man do the whole work in 16 x 2 x (N + 16) days
∴ 48N = 32(N + 16)
∴ N = 32 men