#abc228e. E - Integer Sequence Fair
E - Integer Sequence Fair
Score : points
问题描述
整数序列展览正在进行,将各种整数序列汇聚一堂并进行评估。在此活动中,每个长度为 的整数序列(其元素取值范围在 到 之间,包括两端点)都会被评估,并赋予一个介于 和 (包括两端点)之间的整数评分。
请计算并输出给定评价序列分配从 到 分的方案数模 的结果。
这里需要注意的是,若存在某个已评估序列 在两种不同的方案中得到了不同的评分,则这两种方案被认为是不同的。
以上为通义千问 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 consisting of integers between and (inclusive) is evaluated and given an integer score between and (inclusive).
Print the number, modulo , of ways to give each of the evaluated sequences a score between and .
Here, two ways are said to be different when there is an evaluated sequence that is given different scores by the two ways.
Constraints
- , , and are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number, modulo , of ways to give each of the evaluated sequences a score between and .
Sample Input 1
2 2 2
Sample Output 1
16
Four sequences are evaluated: , , , and . There are ways to give each of these sequences a score between and , as follows.
- Give to , to , to , and to
- Give to , to , to , and to
- Give to , to , to , and to
- Give to , to , to , and to
- Give to , to , to , and to
Thus, we print .
Sample Input 2
3 14 15926535
Sample Output 2
109718301
Be sure to print the count modulo .
update @ 2024/3/10 09:59:04