$A, B$ and $C$ can do a piece of work 
$A, B$ and $C$ can do a piece of work in $18$, $24$ and $30$ days respectively. $A$ and $B$ work together for a certain number of days. Then $B$ leaves and $C$ joins. They work together for half the number of days for which $A$ and $B$ had worked together. After that $A$ goes away and $B$ rejoins the work. If $B$ and $C$ together complete the remaining work in one third of the number of days for which $A$ and $B$ had previously worked together, for how many days does each of them work?

My attempt:
In $18$ days, $A$ can do $1$ work
In $1$ day, $A$ can do $\frac{1}{18}$ work
In $1$ day, $B$ can do $\frac{1}{24}$ work
In $1$ day, $C$ can do $\frac{1}{30}$ work

Let the time worked by $A$ and $B$ together be $x$ days.
Then, the fraction of work done by $A$ and $B$ together $=\frac x{18}+\frac x{24}$.
Time worked by $A$ and $C$ will then be $\frac x2$ days.
The fraction of work done by them $=\frac{x}{2\times18}+\frac{x}{2\times30}=\frac x{36} + \frac x{60}$
Time worked by $B$ and $C$ is given to be $\frac x3$ days.
The fraction of work done by the pair $=\frac{x}{3\times24}+\frac{x}{3\times30}=\frac x{72}+\frac x{90}$
But by now, the work is complete.
Thus,
$$\frac x{18}+\frac x{24}+\frac x{36} + \frac x{60}+\frac x{72}+\frac x{90} = 1$$
Solve for $x$.
