시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 0 0 0 0.000%

문제

6, 10, 15는 제곱수가 아니다. 하지만, 세 수를 곱한 수 900은 제곱수이다.

이러한 원소의 곱이 제곱수가 되는 양의 정수로 이루어진 집합을 "흥미로운 집합"이라고 한다. {6, 10, 15}와 {25}는 흥미로운 집합이다.

또, 흥미로운 집합에서 원소의 곱을 흥미로운 집합의 값이라고 한다.

집합 S가 주어졌을 때, S의 공집합이 아닌 부분집합 중에서 가장 작은 흥미로운 집합의 값을 구하는 프로그램을 작성하시오.

입력

입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 한 줄로 되어 있고, 두 정수 a와 b를 포함하고 있다. (1 < a < b ≤ 4900) 두 수는 집합 S를 나타낸다. S = {x ∈ N | a ≤ x ≤ b} (N은 자연수 집합)

출력

각 테스트 케이스에 대해서, S의 공집합이 아닌 부분집합 중 흥미로운 집합의 값이 가장 작은 집합의 값을 k2라고 했을 때, k를 출력한다. 만약, 흥미로운 집합이 없다면 none을 출력한다.

예제 입력 1

20 30
101 110
2337 2392

예제 출력 1

5
none
3580746020392020480
W3sicHJvYmxlbV9pZCI6IjM2NDciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQ3NjVcdWJiZjhcdWI4NWNcdWM2YjQgXHVjOWQxXHVkNTY5IiwiZGVzY3JpcHRpb24iOiI8cD5cclxuXHQ2LCAxMCwgMTVcdWIyOTQgXHVjODFjXHVhY2YxXHVjMjE4XHVhYzAwIFx1YzU0NFx1YjJjOFx1YjJlNC4gXHVkNTU4XHVjOWMwXHViOWNjLCBcdWMxMzggXHVjMjE4XHViOTdjIFx1YWNmMVx1ZDU1YyBcdWMyMTggOTAwXHVjNzQwIFx1YzgxY1x1YWNmMVx1YzIxOFx1Yzc3NFx1YjJlNC48XC9wPlxyXG5cclxuPHA+XHJcblx0XHVjNzc0XHViN2VjXHVkNTVjIFx1YzZkMFx1YzE4Y1x1Yzc1O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