atcoder#ABC228E. [ABC228E] Integer Sequence Fair

[ABC228E] Integer Sequence Fair

Score : 500500 points

Problem Statement

Integer Sequence Exhibition is taking place, where integer sequences are gathered in one place and evaluated. Here, every integer sequence of length NN consisting of integers between 11 and KK (inclusive) is evaluated and given an integer score between 11 and MM (inclusive).

Print the number, modulo 998244353998244353, of ways to give each of the evaluated sequences a score between 11 and MM.

Here, two ways are said to be different when there is an evaluated sequence A=(A1,A2,,AN)A = (A_1, A_2, \ldots, A_N) that is given different scores by the two ways.

Constraints

  • 1N,K,M10181 \leq N, K, M \leq 10^{18}
  • NN, KK, and MM are integers.

Input

Input is given from Standard Input in the following format:

NN KK MM

Output

Print the number, modulo 998244353998244353, of ways to give each of the evaluated sequences a score between 11 and MM.

2 2 2
16

Four sequences are evaluated: (1,1)(1, 1), (1,2)(1, 2), (2,1)(2, 1), and (2,2)(2, 2). There are 1616 ways to give each of these sequences a score between 11 and 22, as follows.

  • Give 11 to (1,1)(1, 1), 11 to (1,2)(1, 2), 11 to (2,1)(2, 1), and 11 to (2,2)(2, 2)
  • Give 11 to (1,1)(1, 1), 11 to (1,2)(1, 2), 11 to (2,1)(2, 1), and 22 to (2,2)(2, 2)
  • Give 11 to (1,1)(1, 1), 11 to (1,2)(1, 2), 22 to (2,1)(2, 1), and 11 to (2,2)(2, 2)
  • Give 11 to (1,1)(1, 1), 11 to (1,2)(1, 2), 22 to (2,1)(2, 1), and 22 to (2,2)(2, 2)
  • \cdots
  • Give 22 to (1,1)(1, 1), 22 to (1,2)(1, 2), 22 to (2,1)(2, 1), and 22 to (2,2)(2, 2)

Thus, we print 1616.

3 14 15926535
109718301

Be sure to print the count modulo 998244353998244353.