Another question for my impossible math question file.
All of the given pairs of values result in an equation with exactly one solution, as will any pair such that Q≠13 and P≠12.
For Q=13 and P≠12, there is no solution.
For Q=13 and P=12, there will be an infinite number of solutions.