#K66667. GCD and LCM Reconstruction
GCD and LCM Reconstruction
GCD and LCM Reconstruction
You are given two positive integers \(g\) and \(l\) representing the greatest common divisor (GCD) and the least common multiple (LCM) of two unknown positive integers \(x\) and \(y\), respectively. Your task is to find a pair \((x, y)\) such that:
[ \gcd(x, y) = g \quad \text{and} \quad \operatorname{lcm}(x, y) = l. ]
If such a pair exists, print any valid pair \(x\) and \(y\) (separated by a space). Otherwise, output \(-1\).
Hint: It is known that if \(x = g \cdot a\) and \(y = g \cdot b\) with \(\gcd(a, b) = 1\), then the equation \(a \cdot b = l/g\) must hold.
inputFormat
The input consists of a single line containing two positive integers \(g\) and \(l\), separated by a space.
\(g\): the given greatest common divisor of \(x\) and \(y\).
\(l\): the given least common multiple of \(x\) and \(y\).
outputFormat
If a valid pair \((x, y)\) exists, output the two numbers separated by a space. Otherwise, output \(-1\).
## sample3 60
3 20