[2024 GDCPC G]Menji 和 gcd
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.
Background
Special for beginners, ^_^
Description
Menji 喜欢最大公约数,特别是最大公约数大的正整数对。
令 表示 的最大公约数,多次给定 ,保证 ,求 。
Format
Input
第一行一个正整数 ,表示数据组数。
之后 行,每行两个正整数 ,表示一组询问。
Output
对于每个询问 ,输出一行一个正整数 。
Samples
10
1 2
2 4
6 10
11 21
147 154
1470 1540
2890 3028
998244353 1000000007
34827364537 41029384775
147147147147 154154154154
1
2
3
7
7
70
126
1754385
5861340682
7007007007
Limitation
2s, 1024KiB for each test case.
2024广东省大学生程序设计竞赛(重现赛)
- Status
- Done
- Rule
- XCPC
- Problem
- 10
- Start at
- 2026-10-30 13:00
- End at
- 2026-10-30 18:00
- Duration
- 5 hour(s)
- Host
- Partic.
- 2