In a public square, there is a fountain that is formed by two cylinders, one with radius $r$ and height $h_1$, and the other with radius $R$ and height $h_2$. The middle cylinder fills and, after overflowing, starts to fill the other one.
If $R= r \sqrt{2}$ and $h_2=\frac{h_1}{3}$ and, to fill the middle cylinder, it took $30$ minutes, then, to fill this source and the second cylinder so that it is completely full, how many minutes will it take?
I made the following attempt:
If the middle cylinder has a volume equal to $\pi r^2 3h_2$, and the second cylinder has a volume equal to $\pi \left(r \sqrt{2}\right)^2 h_2$, then we have $x$ are the minutes it takes to fill the font completely: $$\frac{\pi r^2 3h_2}{\left(\pi \left(r \sqrt{2}\right)^2 h_2\right)+\left(\pi r^2 3h_2\right)}=\frac{30}{x} $$ $$x= 50$$
But the answer is 40 minutes. Where am I going wrong?

Note that part of the second cylinder includes the middle cylinder so by the time that the middle cylinder is filled, you have already filled a portion of the second cylinder. The total volume of the fountain is $(\pi(r\sqrt{2})^2h_2)+(\pi r^2(3h_2))-(\pi r^2 h_2)=4\pi r^2h_2$
Hence, we have $\frac{3\pi r^2h_2}{4\pi r^2h_2}=\frac{30}{x}\implies x=40$