Somewhat unusual projectile motion question 
A stone must fly over two walls of height $h_1$ and $h_2$ $(h_2~ > ~h_1)$ from the side of the lower wall. The distance between the upper points of the two walls near which the stone's trajectory lies is $L$. Find the minimum velocity of the stone. (source: AN Matveev's Mechanics and Relativity).
Answer:$\sqrt{g(h_1+h_2+L)}$, where $g$ is acceleration due to gravity

The rather terse nature of the problem statement is very typical of Russian texts. I'm an intermediate/advanced self-learner and I love to wrangle with these kinds of problems. This problem seemed like a basic projectile motion problem but this has got me in knots - If the limiting height is $h_2$, why does the problem need $h_1$? And, there is no angle to use either. What's the significance of the requirement for minimum velocity? Clearly, it has to cross the walls, and based on what I see, $h_1$ likely lies below the trajectory and $h_2$ must just touch the trajectory and this can potentially give the velocity. But, I'm unable to find the approach to solve this. Can anyone provide a way to think about this problem?
 A: The problem is kind of hard to solve if one is not careful. One can write the satisfying equations but still might not be able to find the answer. I will outline a way to this.
The idea is that at the minimum required velocity the projectile just touches the top of the walls. Let the velocity and angle of projection at the origin be $v_0$ and $\theta _0$. From the origin the projectile goes and touches the top of the first wall. You can view the rest of its motion as a projectile projected from the top of the first wall with velocity $v_1$ at an angle $\theta_1$(both are unknown at this point). The following relation holds $$ v_1 ^2 = v_0 ^2 -2gh_1.$$ 
Define $\sin(\phi) = \frac{h_2 - h_1}{L}$.
The projectile should now go and touch the top of the second wall which means w.r.t the new origin it must pass through the point $(L cos(\phi), h_2 - h_1)$. You can plug this in to the equation of projectile parabola to get.
$$h_2 - h_1 = \tan(\theta_1)[L\cos(\phi)] - \frac{gL^2\cos^2(\phi)}{2(v_0^2 -2gh_1)\cos^2(\theta_1)}$$.
Now rearrange this and write $v_0$ in terms of $\theta_1$. Everything else are parameters given in the question. Use calculus to minimize the value of $v_0$. You'll get the answer. Let me know if anything is not clear.
A: The space between the tops of the two walls can be thought of as an inclined plane. Then the problem is to find the minimum speed to cover distance $L$ on a plane inclined at $\theta$ to the horizontal where $L\sin\theta=h_2-h_1$. (I assume we are launching up the plane. However, the projectile can follow the same total trajectory in reverse with the same launch velocity from the ground, because the trajectory is symmetrical. So we can always arrange to launch up the inclined plane.)  
The maximum range on an inclined plane is given by $$R=\frac{u^2}{g(1+\sin\theta)}$$ Using $R=L$ we get a minimum launch speed of $u$ given by $$u^2=g(L+h_2-h_1)$$ To obtain speed $u$ at height $h_1$ above the ground the stone must be launched with speed $v$ given by $$v^2=u^2+2gh_1$$ Therefore $$v^2=g(L+h_1+h_2)$$
A: The path of the projectile will be a parabola.  Let $x$ be horizontal and $y$ be vertical.  It is not obvious where to place the origin, so let it be at the peak of the parabola.  Let the launch velocity be $v0$ and the launch angle above the horizontal be $\theta$. Then the horizontal velocity is constant as $x'=v0 \cdot \cos \theta$ and if we let the origin of time be when the projectile hits the peak we have $x=v0 \cdot \cos \theta \cdot t$.  We also have $y=-\frac 12gt^2$ as at the origin of time we have $y=0, y'=0$  Combining these, the path is $y=-\frac 12 g(\frac x{v \cdot \cos \theta})^2$.  You have four unknowns, $v0, \theta,$ and the $x,y$ of the launch point. You have two equations coming from the fact that the projectile just touches the top of each wall, one from the fact that it launches at the same $y$ as the base of the walls and one because the arrival point is opposite in $x$ from the launch point.
A: Considering the movement origin at the top of $h_1 \le h_2$ and calling $v_1^2 = v_x^2+v_y^2$ the required initial velocity at this point, we have
$$
\frac{v_y}{v_x}(x_2-x_1)-\frac 12 \frac{g}{v_x^2}(x_2-x_1)^2 = h_2-h_1
$$
then
$$
v_y = v_x\frac{h_2-h_1}{x_2-x_1}+\frac 12\frac{g}{v_x}(x_2-x_1)
$$
but calling $v_0$ the ground initial velocity we have
$$
v_0^2 = v_1^2+2h_1 g = v_x^2+\left(v_x\frac{h_2-h_1}{x_2-x_1}+\frac 12\frac{g}{v_x}(x_2-x_1)\right)^2+2h_1g
$$
Finally calculating the minimum of $v_0^2(v_x)$ we obtain 
$$
v_0^2=\left(h_1+h_2+L\right)g
$$
