9157: Differential Equation

内存限制:128 MB 时间限制:3 S
题面:传统 评测方式:文本比较 上传者:
提交:0 通过:0

题目描述


AntiLeaf is a master on solving differential equations and polynomial techniques, thus he has came out the following problem for you.

There is a series of functions Fk(x)F_k(x)Fk(x), where kkk is a natural number, and xxx is the independent variable. The value of Fk(x)F_k(x)Fk(x) is defined as follows:

  • F0(x)=xF_0(x) = xF0(x)=x;
  • For any non-zero kkk, Fk(x)=(x2−1)Fk−1′(x)F_k(x) = \left( x^2 - 1 \right) F'_{k - 1}(x)Fk(x)=(x21)Fk1(x), where Fk−1′(x)F'_{k - 1}(x)Fk1(x) denotes the derivative of Fk−1(x)F_{k - 1}(x)Fk1(x).

Given a non-negative integer nnn and a non-negative integer x0x_0x0, please calculate the value of Fn(x0)F_{n}(x_0)Fn(x0).

Since the answer may be very large, you are required to output the answer modulo 998,244,353998,244,353998,244,353. It can be proved that the answer is always an integer.

输入格式


The only line of input consists of two integers nnn (0≤n≤2×1050 \le n \le 2 \times 10^50n2×105) and x0x_0x0 (0≤x0≤998,244,3520 \le x_0 \le 998,244,3520x0998,244,352).

输出格式


Print one non-negative integer in one line, representing the value of Fn(x0)F_n(x_0)Fn(x0) modulo 998,244,353998,244,353998,244,353.

输入样例 复制

3 2

输出样例 复制

66

数据范围与提示


F0(x)F1(x)F2(x)F3(x)=x=x21=2x32x=6x48x2+2
Therefore F3(2)=6×16−8×4+2=66F_3(2) = 6 \times 16 - 8 \times 4 + 2 = 66F3(2)=6×168×4+2=66

分类标签