Part of work done by A in 1day:140
∵A worked for 5 days.
∴ Part of work done by A in 5day:140×5=18
∵A left after 5 days and remaining work was completed by B in 21 days.
Remaining work =1−18=8−18=78
∵78 th part of work completed by B in 21 days.
∴1 complete work was completed by B in 2178 days.
=21×87 days
=24 days.
∵A complete the whole work in 40 days and B complete the whole work in 24 days.
∴ if A and B work together
∴ time taken by A and B togethere to complete the work
=40×2440+24 days (Formula A complete work in X days. B complete work in Y days. A and B can complete work in (X×YX+Y)
=40×2464 days
15 days.