Total work Needs to Done = LCM(8,10) = 40 units
A's one day's work = 40/8 = 5 Unit
B's one day's work = 40/10 = 4 Unit
Together They can DO 5 + 4 =9 units of work per day
(5 + 4 ) * 4 =36 units =8 days
Remaining 40-36 =4 unit of work
If A start first 4/5 day Here Ans = 8 (4/5 ) days
If B start first 4/4 = 1 more day Here Ans = 9 days