Problem list
Log in
#r03119 · Online Judge > GoldOJ

GCD and LCM

Bronze I 2.0 s 1024 MB

Given two natural numbers $A$ and $B$, print their greatest common divisor and least common multiple, separated by a space.

Input

One line: two integers $A$ and $B$ ($1 \le A, B \le 10^9$).

Output

Print $\gcd(A, B)$ and $\operatorname{lcm}(A, B)$.

Example 1

Input
24 60
Output
12 120

Example 2

Input
1000000000 750000000
Output
250000000 3000000000
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code