Answer
$59.44\;\rm m$, $-10.82\;\rm m$
Work Step by Step
We need to make the touching velocity just at the same angle as the ramp which means it must be 20$^\circ$ below the horizontal, as you see in the figure below.
Now we know that the horizontal velocity component is constant, which means that
$$v_x=v_0=40{\;\rm m/s}=\dfrac{\Delta x}{t}$$
Thus,
$$\Delta x=40t\tag 1$$
We know that $a_y=-g$, so
$$ \Delta y=v_{0y}y-\frac{1}{2}gt^2= 0-4.9t^2$$
$$\Delta y=-4.9t^2\tag 2$$
We know that $\tan (-20^\circ)=\dfrac{v_y}{v_x}$
Thus,
$$\tan (-20^\circ)=\dfrac{v_y}{v_x}=\dfrac{v_y}{40}$$
Thus,
$$v_y=40\tan (-20^\circ)=-14.56\;\rm m/s$$
Now we can find $t$ by using the formula of
$$v_{y}=v_{0y}+a_yt$$
Plugging the known;
$$-14.56=0-9.8t$$
$$t=1.486\;\rm s$$
Plugging into (1) and (2);
$$\Delta x=40\cdot 1.486=\color{red}{\bf59.44}\;\rm m$$
$$\Delta y=-4.9\cdot 1.486^2=\color{red}{\bf -10.82}\;\rm m$$