p-mv2\r=mg make m the subject

just divide both sides by g