Let us write the given pair of equation as

These equation are not in the form ax+by+c=0. However, if we substitute

So, we have expressed the equations as a pair of linear equations. Now, you can use any method to solve these equations, and get p=2, q=3
