~/algor $ cat problems/for-ichma-ich-ildizlar
Nested roots
Medium
1000 ms
64 MB
45%
An integer $a$ and a positive integer $N$ are given. Compute the value of the expression in which $N$ root signs are nested inside each other:
$$R = \underbrace{\sqrt{a + \sqrt{a + \dots + \sqrt{a}}}}_{N \text{ roots}}$$
For $N = 1$, $R = \sqrt{a}$; for $N = 2$, $R = \sqrt{a + \sqrt{a}}$.
Input
One line with two integers: $a$ and $N$.
Output
One number — $R$, with exactly 6 digits after the decimal point (for example, 1.961571).
Note
$0 \le a \le 100$
$1 \le N \le 50$
Examples
Input #1
2 3
Output #1
1.961571
Input #2
6 2
Output #2
2.906801