Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/oraliqdagi-kvadrat-sonlar

Perfect squares in a range

Easy 1000 ms 64 MB 21%
Share

Two positive integers $a$ and $b$ are given. Print in increasing order all perfect squares ($1, 4, 9, 16, \dots$ — squares of positive integers) from $a$ to $b$ (both inclusive). If there are none, print $-1$.

The segment from a to b on the number line; the perfect squares in it are highlighted

Input

One line with two positive integers: $a$ and $b$.

Output

The perfect squares separated by spaces, or $-1$.

Note

$1 \le a \le b \le 10^{9}$

Examples

Input #1
10 50
Output #1
16 25 36 49
Input #2
17 24
Output #2
-1

Sign in to submit a solution

Signing up is free and takes a minute.