#P8158. 「PMOI-5」分力

「PMOI-5」分力

Description

There is a circle with radius 11 and center at (0,0)(0,0) on the Cartesian plane.

On this circle, nn red points are marked at equal distances, and one of the points lies on the positive xx-axis.

NaCly_Fish is also at (0,0)(0,0). She randomly chooses a red point with equal probability and pushes toward it with a force of 1N1 \text N.

Let the components of her pushing force on the xx and yy axes be FxF_x and FyF_y. She wants to know the kk-th central moments of these two random variables.

For a random variable xx, its kk-th central moment is defined as E((xE(x))k)E((x-E(x))^k), where E(x)E(x) is the expected value of xx.

It can be proved that the answer must be a rational number, so output the answer modulo 998244353998244353.

Input Format

Input one line with two positive integers n,kn, k.

Output Format

Output one line with two integers, representing the kk-th central moments of FxF_x and FyF_y, respectively.

2 2
1 0
5 15
815216641 0
114 514
636199406 569855248

Hint

[Explanation for Sample 1]
The second central moment is the variance. Since she can only push in the positive or negative xx direction, FyF_y is always zero, so its variance is also zero. FxF_x can be ±1\pm 1 with equal probability, so the variance is 11.

[Constraints]

This problem uses bundled testdata.

  • Subtask 1 (7 pts): 2n,k202\le n,k \le 20;
  • Subtask 2 (14 pts): 2n1002\le n \le 100;
  • Subtask 3 (19 pts): 2n1032\le n \le 10^3;
  • Subtask 4 (23 pts): 2k1072\le k \le 10^7;
  • Subtask 5 (37 pts): no special restrictions.

For 100%100\% of the testdata, 2n3×1042\le n \le 3 \times 10^4 and 2k1092\le k \le 10^9.

Translated by ChatGPT 5