If (x-2) and (x-1/2) are the factors of the polynomial qx2+5x+p, then find the relation between p and q.