~/algor $ cat problems/oraliqdagi-kvadrat-sonlar
Perfect squares in a range
Easy
1000 ms
64 MB
21%
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$.
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