#B2146. Compute Hermite Polynomial Value

    ID: 11228 Type: Default 1000ms 256MiB

Compute Hermite Polynomial Value

Compute Hermite Polynomial Value

Given a real number x and a positive integer n, compute the value of the Hermite polynomial defined as:

$$ \displaystyle h_n(x)=\begin{cases} 1,& n=0,\\ 2x,& n=1,\\ 2x\,h_{n-1}(x)-2(n-1)\,h_{n-2}(x),& n>1. \end{cases} $$

Your task is to output the value of hn(x).

inputFormat

The input consists of two values: a real number x and a positive integer n, separated by space.

outputFormat

Output a single number which represents the value of the Hermite polynomial hn(x).

sample

1 0
1