start by making a table

t p q

0 0 -5

1 2 2

2 6 12

3 12 25

this gives you an idea of whats happening. you can see that you can make an equation for both particles

we know that acceleration for p, or p'' is:

p''=2 so we can get

p' = 2x + c where c represents initial speed, in this case...

p' = 2x + 0 (it started at rest)

then we find its position

p = x^2 + c where c=0 (or at least 5 more than c in q(x))

then do the same for q

q''= 3

q' = 3x + c (initial speed was 5m/s)

q' = 3x + 5

q = (3/2)x^2 + 5x + c (initial positon was 5 behind p)

q = (3/2)x^2 + 5x - 5

now set p and q equal to eachother and that will tell you the moment they intersected.