#1 格式測試

第一行輸入 n,為正整數,代表有 n 筆測資,行末換行。
在接下來的 n 行中,均輸入 a b,行末換行。其中:

−2×109≤a,b≤2×109,a,b∈ℤ

對於每筆測資,輸出 a 和 b 的最大公因數與最小公倍數(均為非負整數)並以恰一個空白分隔,行末換行。

範例輸入

4
12 18
7 1
4 4
9 6

範例輸出

6 36
1 7
4 4
3 18

Submit a solution

Log in to submit a solution.

Details

Time limit
1000 ms
Memory limit
256 MB
Scoring
Subtasks
Checker
Exact match
Author
admin

Subtasks

#TestcasesPoints
110
2232
3467
411

Statistics

VerdictCountShare
AcceptedAC125%
Presentation ErrorPE125%
Compile ErrorCE250%

Fastest solutions

UserLanguageTime
userC++17150 ms