solve a*n+b*m=p, c*n+d*m=q for n,m