2 groups of people $A$ and $B$ are trying to build a road.
For the first 40 days, only one group was working at any time.
At first, only group $A$ worked. They worked for an unknown amount of days, and finished $\frac{1}{3}$ of the road.
After that, only group $B$ worked, they worked until the end of the 40th day and finished $\frac{1}{6}$ of the road.
On day number $41$ and afterwards, both groups worked together, and they finished building the road in $18$ days.
The question is - how long would it take each individual group to build the entire road alone?
I can't seem to solve it. if $x$ is the rate at which $A$ work, and $y$ is the rate at which $B$ work, then we know $18(x+y)=1-\frac{1}{3}-\frac{1}{6}=\frac{1}{2}$
But from where can we get another equation? the fact that $A$ worked for an unknown number of days before $B$ is a problem.
HINT : Let $d$ be the number of days that only $A$ worked. Then, we have $$x=\frac{1}{3d},\ \ y=\frac{1}{6(40-d)}.$$ So, you have $$18\left(\frac{1}{3d}+\frac{1}{6(40-d)}\right)=\frac 12.$$