snailey, I was about to answer that question. Anyways you did and thank you.See, one easy way to solve these type of questions is to first find out the half of the middle value.
For example im this case x^2-6x+10
half of 6 will be so (x-3)^2
now when you expand this you get x^2-3x-3x+9.
So now to get to the given question you have to add 1.
So p is 3 and q is 1.