#B2146. Hermite 多项式

Hermite 多项式

Hermite 多项式

  • 时间限制:1 秒
  • 内存限制:128 MiB

题目描述

求 Hermite 多项式的值。

$$h_n(x)=\left\{ \begin{aligned} 1&,&n=0\\ 2x&,&n=1\\ 2xh_{n-1}(x)-2(n-1)h_{n-2}(x)&,& n>1 \end{aligned} \right.$$

对给定的 xx 和正整数 nn,求多项式的值。

输入格式

输入两个正整数 nn 和 xx 。

输出格式

求多项式的值。

样例输入 1

1 2

样例输出 1

4

数据范围

对于所有测试数据,保证:

  • n,xn,x 为整数,且 1≤n≤81\le n\le8、1≤x≤81\le x\le8。

附件

hermite.zip