First we look at the max distance throw to determine the speed the ball is thrown with.

Since there is no acceleration in the x-direction, we can find the time t it takes to go s.
In the y direction, the displacement is zero because it returns to the same height it was thrown at, the acceleration is g, and the initial velocity is
. The final velocity is
because of the symmetry of projectile motion.
Now we know that we throw the ball straight up with a speed
.
When the ball reaches maximum height, its velocity is zero.