Ratio of times taken by A and B = 1 : 2.
The time difference is (2 - 1) 1 day while B take 2 days and A takes 1 day.
If difference of time is 1 day, B takes 2 days.
If difference of time is 30 days, B takes 2 x 30 = 60 days.
So, A takes 30 days to do the work.
A's 1 day's work = 1/30
B's 1 day's work = 1/60
(A + B)'s 1 day's work = 1/30 + 1/60 = 1/20
A and B together can do the work in 20 days.