Since three lines $x - 3y = p$,
$ax + 2y = q$ and $ax + y = r$
form a right angled triangle
$\therefore $ product of slopes of any two lines $= -1$
Suppose $ax + 2y = q$ and $x - 3y = pare \,\bot$ to each other.
$\therefore \quad \frac{-a}{2}\times\frac{1}{3} = -1 \Rightarrow a = 6$
Now, consider option one by one
$a = 6$ satisfies only option
$\therefore $ Required answer is $a^{2} - 9a +18 = 0$