#abc228e. E - Integer Sequence Fair

E - Integer Sequence Fair

Score : 500500 points

问题描述

整数序列展览正在进行,将各种整数序列汇聚一堂并进行评估。在此活动中,每个长度为 NN 的整数序列(其元素取值范围在 11KK 之间,包括两端点)都会被评估,并赋予一个介于 11MM(包括两端点)之间的整数评分。

请计算并输出给定评价序列分配从 11MM 分的方案数模 998244353998244353 的结果。

这里需要注意的是,若存在某个已评估序列 A=(A1,A2,,AN)A = (A_1, A_2, \ldots, A_N) 在两种不同的方案中得到了不同的评分,则这两种方案被认为是不同的。

以上为通义千问 qwen-max 翻译,仅供参考。

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.

Sample Input 1

2 2 2

Sample Output 1

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.

Sample Input 2

3 14 15926535

Sample Output 2

109718301

Be sure to print the count modulo 998244353998244353.

update @ 2024/3/10 09:59:04