Square Root Distance from Integers Given a decimal number k, find the smallest integer n such that the square root of n is within k of an integer. However, the distance should be nonzero - n cannot be a perfect square.

Given k, a decimal number or a fraction (whichever is easier for you), such that 0 &lt; k &lt; 1, output the smallest positive integer n such that the difference between the square root of n and the closest integer to the square root of n is less than or equal to k but nonzero.

If i is the closest integer to the square root of n, you are looking for the first n where 0 &lt; |i - sqrt(n)| &lt;= k.

Rules


You cannot use a language's insufficient implementation of non-integer numbers to trivialize the problem.
Otherwise, you can assume that k will not cause problems with, for example, floating point rounding.


Test Cases

.9         &gt; 2
.5         &gt; 2
.4         &gt; 3
.3         &gt; 3
.25        &gt; 5
.2         &gt; 8
.1         &gt; 26
.05        &gt; 101
.03        &gt; 288
.01        &gt; 2501
.005       &gt; 10001
.003       &gt; 27888
.001       &gt; 250001
.0005      &gt; 1000001
.0003      &gt; 2778888
.0001      &gt; 25000001
.0314159   &gt; 255
.00314159  &gt; 25599
.000314159 &gt; 2534463


Comma separated test case inputs: 

0.9, 0.5, 0.4, 0.3, 0.25, 0.2, 0.1, 0.05, 0.03, 0.01, 0.005, 0.003, 0.001, 0.0005, 0.0003, 0.0001, 0.0314159, 0.00314159, 0.000314159


This is code-golf, so shortest answer in bytes wins.
Wolfram Language (Mathematica), 34 bytes

Min[⌈.5/#+{-#,#}/2⌉^2+{1,-1}]&amp;


Try it online!

Explanation

The result must be of the form \$m^2 \pm 1\$ for some \$m \in \mathbb{N}\$. Solving the inequations \$\sqrt{m^2+1} - m \le k\$ and \$m - \sqrt{m^2-1} \le k\$, we get \$m \ge \frac{1-k^2}{2k}\$ and \$m \ge \frac{1+k^2}{2k}\$ respectively. So the result is \$\operatorname{min}\left({\left\lceil \frac{1-k^2}{2k} \right\rceil}^2+1, {\left\lceil \frac{1+k^2}{2k} \right\rceil}^2-1\right)\$.