CF1091G
省流:分解大数 n,交互库提供一个计算器给你使用。
样例输入 1
代码21
样例输出 1
代码! 3 7
Note
We start by reading the first line containing the integer n=21. Then, we ask for:
- (12+16)mod21=28mod21=7.
- (6−10)mod21=−4mod21=17.
- (8⋅15)mod21=120mod21=15.
- (5⋅4−1)mod21=(5⋅16)mod21=80mod21=17.
- Square root of 16. The answer is 11, as (11⋅11)mod21=121mod21=16. Note that the answer may as well be 10.
- Square root of 5. There is no x such that x2mod21=5, so the output is −1.
- (612)mod21=2176782336mod21=15.
We conclude that our calculator is working, stop fooling around and realise that 21=3⋅7.