Answer:
Both energies are equal when the rock has fallen 20 m or equivalently when it is at a height of 20 m.
Step-by-step explanation:
Potential and Kinetic Energy
The gravitational potential energy is the energy an object has due to its height above the ground. The formula is

Where:
m = mass of the object
g = acceleration of gravity (9.8~m/s^2)
h = height
Note we can also use the object's weight W=mg into the formula:

The kinetic energy is the energy an object has due to its speed:

Where v is the object's speed.
Initially, the object has no kinetic energy because it's assumed at rest.
The W=30 N rock falls from a height of h=40 m, thus:

Since the sum of the kinetic and potential energies is constant:
U' + K' = 1,200 J
Here, U' and K' are the energies at any point of the motion. Since both must be the same:
U' = K' = 600 J
U'=Wh'=600
Solving for h':

Both energies are equal when the rock has fallen 20 m or equivalently when it is at a height of 20 m.