The minimum distance will be found when Q moves with 10m/s velocity which can be found by,
v=u+at
10=0+2t
t=5sec.
Distance traveled by P in 5 seconds is 5×10=50m.
And distance traveled by Q in 5 seconds is=0.5×2×52=25m.
So minimum distance between P and Q will be 40+25−50=15m