Solve the equation for r\displaystyle {r}

rq+py=rm+g\displaystyle {r}{q}+{p}{y}={r}{m}+{g}

r=\displaystyle {r}=