Using
the section formula, if a point (x,y) divides the line joining the points
(x1,y1) and (x2,y2) in the ratio m:n, then (x,y)=(mx2+nx1m+n,my2+ny1m+n)
Let the ratio be k:1
Substituting (x1,y1)=(1,3) and (x2,y2)=(2,7) in the
section formula, we get the point which divides as (k(2)+1(1)k+1,k(7)+1(3)k+1)=(2k+1k+1,7k+3k+1) Since this point lies on the line 3x+y−9=0, we have
3(2k+1k+1)+7k+3k+1−9=0
=>6k+3+7k+3−9k−9=0
4k−3=0
k=34
Hence, the ratio is 3:4 internally.
Thus p:q=3:4
And therefore p+q=3+4=7