According to Newton's second law of motion, the force acting on a body is equal to the rate of change of momentum during impact
$ F = \frac{ \triangle p }{ \triangle t } $
Also, $ F = ma \Rightarrow ma = \frac{ p_2 - p_1 }{ \triangle t } $
$\Rightarrow a = \frac{ ( mv_2 - ( - mv_1 ) }{ m \triangle t } $
= $ \frac{ v_2 + v_1 }{ \triangle t } $
So, $ a = \frac{ \sqrt{ 2 \times 10 \times 20 } + \sqrt { 2\times 10 \times 5 }}{ 0.02 } $
= $ \frac{ 20 + 10}{ 0.02 } = 1500 \, ms^{ - 2}$