#C. Product and GCD

    Type: Default 1000ms 256MiB

Product and 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.

Product and GCD

题面翻译

给你 22 个整数 N,PN,P

你需要构造一个有 NN 个数的整数序列 aa,满足以下条件:

i=1,2,..,N,ai1\forall i=1,2,..,N,a_i\ge 1

i=1Nai=P\prod\limits_{i=1}^{N}a_i=P

gcdi=1Nai\gcd\limits_{i=1}^{N}a_i 可能的最大值。

1N,P10121\le N,P\le 10^{12}

输入格式

两个正整数 N,PN,P

输出格式

一个整数表示答案。

样例 #1

样例输入 #1

3 24

样例输出 #1

2

样例 #2

样例输入 #2

5 1

样例输出 #2

1

样例 #3

样例输入 #3

1 111

样例输出 #3

111

样例 #4

样例输入 #4

4 972439611840

样例输出 #4

206

数据范围

1  N  10121\ \leq\ N\ \leq\ 10^{12} 1  P  10121\ \leq\ P\ \leq\ 10^{12}

样例解释 1

一个最优解为 a1=2, a2=6, a3=2a_1=2,\ a_2=6,\ a_3=2 ,最大公约数为 22

样例解释 2

由于 aia_i 都是正整数,因此只能a1 = a2 = a3 = a4 = a5 = 1a_1\ =\ a_2\ =\ a_3\ =\ a_4\ =\ a_5\ =\ 1

20240910集训

Not Attended
Status
Done
Rule
IOI(Strict)
Problem
6
Start at
2024-9-10 19:00
End at
2024-9-10 21:00
Duration
2 hour(s)
Host
Partic.
26