Unable to understand the question


#1

As 0 is neither positive or negative. The least possible value we can assume would be Z = 1.
and let’s substitute the same.
As for example
A = 2 & B = 3

Z= PA + QB

1-PA= QB

and for any given inputs of A & B, we can always find a Q & P as integers for the derived equation. So for any input, the minimum value will always be 1.

Or did I miss anything ?


#2

p q are integers
blablablablablablablabla


#3

Minimum difference cannot always be 1. it will be the gcd of two numbers. Try to check extended euclidean algorithm