$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: 
$x$ the number of days that $A$ and $B$ worked together, 
then $A$ and $C$ worked together $x/2$ days, 
and $B$ and $C$ worked $x/3$ days together.
So, we have
\begin{align}
x\left(\frac{1}{18}+\frac{1}{24}\right)+\frac{x}{2}\left(\frac{1}{18}+\frac{1}{30}\right)+\frac{x}{3}\left(\frac{1}{24}+\frac{1}{30}\right)&=1
\end{align}
