PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000089. Tìm số B nhỏ nhất theo BCNN (Benefit)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Tìm số B nhỏ nhất theo BCNN (Benefit)

Benefit

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given two positive integers AA and CC, find the smallest positive integer BB satisfying lcm⁡(A,B)=C\operatorname{lcm}(A,B)=C. If no positive integer BB satisfies this equation, print the required impossibility token.

Input

One line containing two positive integers AA and CC.

Output

Print the smallest positive integer BB, or NO SOLUTION if none exists.

Subtasks

  • Subtask 1 (20 points): 1≤A,C≤1031\le A,C\le 10^3
  • Subtask 2 (30 points): 1≤A,C≤1051\le A,C\le 10^5
  • Subtask 3 (50 points): 1≤A,C≤1071\le A,C\le 10^7

Examples

Input

32 1760

Output

55

Explanation

We have 32=2532=2^5 and 1760=25⋅5⋅111760=2^5\cdot5\cdot11. Since AA already supplies 252^5, the minimum additional factors are 5⋅11=555\cdot11=55. Thus lcm⁡(32,55)=1760\operatorname{lcm}(32,55)=1760.