eolymp
bolt
Try our new interface for solving problems
Məsələlər

Hip To Be Square

Hip To Be Square

Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB

None of the numbers 6, 10, 15 is a square, but their product, the number 900, is a square. We are interested in sets of positive integers, the product of which is a square. We call such a set HIP (this stands for Has Interesting Product). Evidently {6, 10, 15} is HIP, and so is {25}.

More generally, given a set of positive integers, does it have a non-empty subset which is HIP, and if so, for which of the HIP subsets will the product be minimal?

To make things slightly easier for you, we restrict our attention to intervals.

Giriş verilənləri

Each test case consists of two integers a and b on a single line (1 < a < b4900). These integers describe the interval .

Çıxış verilənləri

For each test case, print the least number k such that the product of the elements of some non-empty subset XAequals k^2. If no such number exists, print 'none'. The number k will be less than 2^63.

Nümunə

Giriş verilənləri #1
20 30
101 110
2337 2392
Çıxış verilənləri #1
5
none
3580746020392020480
Mənbə NWERC 2012 - NorthWestern European Regional Championship 2012