The total time of 3.4 seconds includes the time the rock falls and the time it takes for the sound wave to return to the top of the cliff.
Where d is the height of the cliff in meters, the falling time is
=29.8‾‾‾√
t
f
=
2
d
9.8
... and the sound wave return time is
=340
t
s
=
d
340
We need to set the sum of those two components to 3.4 sec and solve.
3.4=+
3.4
=
t
f
+
t
s
3.4=29.8‾‾‾√+340
3.4
=
2
d
9.8
+
d
340
Not a pretty formula. I found d =51.69+
51.69
+
meters using goal seek. At that height, the rock would fall for 3.25 seconds, and the sound would return in 0.15 seconds, for a total time of 3.40 seconds.