The problem was to find two numbers, a and b
, such that their greatest common divisor and their least common multiple would add up to a given number, x
. Moreover, the difference between the two numbers should be as small as possible, and a
must be less than or equal to b
.
X goes from 2 to 1e9