You just have to arrange the equation such that the p is the only term at the left hand side of the equation. Express it in terms of r and m.
r = 1/2*m²*p Divide both left and right hand side equations by 1/2*m² p = r/(1/2 *m²) Take the reciprocal of 1/2 and multiply it. The final answer is: p = 2r/m²