Given two positive integers a
and b
, output two positive integers c
and d
such that:
c
dividesa
d
dividesb
c
andd
are co-prime- the least common multiple of
c
andd
equals the least common multiple ofa
andb
.
If there are more than one possible answers, you can output only one or all of them.
Test cases:
a b c d
12 18 4 9
18 12 9 4
5 7 5 7
3 6 1 6 or 3 2
9 9 9 1 or 1 9
6 15 2 15 or 6 5
1 1 1 1
This is code-golf. Shortest answer in bytes wins.
d
dividesb
\$\endgroup\$