why not
from the instance when it is going into the plank till 40 cm aplly first eqn. of motion
v^2 / 4 = v^2 -2a*40 - - - - -1
then from 40 cm till it comes to rest
0= v^2 / 4 - 2a*x - - - - -2
(here , x = req. distance , a = acceleration(assumed constant) , and v = = velocity with which it enters plank)
you have two eqns. solve it