OC Practice Week 1

Start

2017-09-13 19:00 CEST

OC Practice Week 1

End

2017-09-20 19:00 CEST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -9 days 11:02:04

Time elapsed

168:00:00

Time remaining

0:00:00

Problem G
Tight words

Given is an alphabet $\{ 0, 1, \dots , k\} , 0 \leq k\leq 9$. We say that a word of length $n$ over this alphabet is tight if any two neighbour digits in the word do not differ by more than 1.

For example if $k=2$, we may only use digits $0, 1, 2$. These are the tight words of length $2$: 00, 01, 10, 11, 12, 21, 22. There are $9$ words of length $2$, so the percentage of tight words is $7/9=77.777\% $.

Input

Input is a sequence of lines, each line contains two integer numbers $k$ and $n$, $1\leq n \leq 100$.

Output

For each line of input, output the percentage of tight words of length $n$ over the alphabet $\{ 0, 1, \dots , k\} $.

The output is considered correct if it is within relative or absolute error $10^{-7}$.

Sample Input 1 Sample Output 1
4 1
2 5
3 5
8 7
100.000000000
40.740740741
17.382812500
0.101296914