Let, the required height of body is y.

When body from rest falls through height (S − y). Then under constant acceleration,
v2 = 02 + 2g(S−y)
v = √2g(S − y) ...(1)
When the body is at height y above the ground. Potential energy of body of mass m,
U = mgy
As per given condition kinetic energy, K = 3U
⇒ \(\frac 12 m(v)^2 = 3 \times mg (y)\) .....(2)
Using equations (1) and (2),
⇒ S − y = 3y
∴ y = \(\frac S4\)
From (1),
\(v = \sqrt{2 \times g(S - \frac S4)}{}\)
\(= \sqrt{\frac {3gS}2}\)