#A. 习题3.2.5 分数约分

    Type: Default File IO: reduce 1000ms 512MiB

习题3.2.5 分数约分

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

小X最近刚刚学习到了分数的知识,他苦恼于将分数化简,现在需要写一个程序来帮助他...

输入格式

第一行给定一个nn,表示要求nn个分数的约分。

接下来nn行,每行两个整数 a b (分别表示分子,分母。)

输出格式

两个整数 x y (分别表示值为a/b的最简分数的分子与分母)

样例数据

input


1

6 2

output


3 1

数据规模与约定

10n10010 \leq n \leq 100

0<a,b<10000000< a,b <1000000

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}

20201007pm基础代码测试

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2020-10-7 15:40
End at
2020-10-7 15:52
Duration
0.2 hour(s)
Host
Partic.
16