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 is between 2 and 1e9
.