3767 - 区间询问
Description

陈老师正在做一道关于区间的问题:

从 [L, R] 中任选两个整数 a, b\ (L \le a \le b \le R),分别求:

  1. \gcd(a, b) 的最小值;

  2. \gcd(a, b) 的最大值;

  3. \operatorname{lcm}(a, b) 的最小值;

  4. \operatorname{lcm}(a, b) 的最大值。

陈老师觉得这题太简单了,所以把这题扔给了你。

相信聪明的你一定能够解决这道题!

Input

输入一行两个整数 L, R。

Output

输出四行,按题目描述中的顺序输出四个答案。

Examples

Input

1 2

Output

1
2
1
2

Input

2 3

Output

1
3
2
6

Input

5 5

Output

5
5
5
5
Hint

样例 2 解释

L = 2, R = 3 时可选的有 (2,2), (2,3), (3,3) 三对:

  • \gcd 最小:\gcd(2,3) = 1;

  • \gcd 最大:\gcd(3,3) = 3;

  • \operatorname{lcm} 最小:\operatorname{lcm}(2,2) = 2;

  • \operatorname{lcm} 最大:\operatorname{lcm}(2,3) = 6。

数据范围

  • 对于 30\% 的数据,1 \le L \le R \le 10^2;

  • 对于 60\% 的数据,1 \le L \le R \le 10^4;

  • 对于 100\% 的数据,1 \le L \le R \le 10^8。

Source
2024CCF入门组模拟赛15(8.9)
Tags
题目参数
Time Limit 1 second
Memory Limit 512 MB
提交次数 11
通过次数 8