An easy way to do this problem is
Let W be the work.
A x 16 = W
B x !2 = W
Total work to be completed is W
Since A and B are working in alternate days , only half of the work they do alone is required when they work together to complete the task.
A + B = W
16 + 12 = 28 = 14
So the days taken to complete the whole work by A and B is 14 days.