QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 1024 MB Puntuación total: 100

#3808. 骰子杯

Estadísticas

在许多桌面游戏中,使用不同的骰子来模拟随机事件是很常见的。字母 “d” 或 “D” 用于表示具有特定面数的骰子,例如 $d4$ 表示一个四面骰子。如果需要投掷多个相同类型的骰子,则会在前面加上一个数字来表示骰子的数量。因此,$2d6$ 意味着玩家应该投掷两个六面骰子并将结果面值相加。

编写一个程序,计算投掷两个骰子时,其点数之和出现概率最高的结果。假设每个骰子的面数从 1 开始编号,且每个面出现的概率相等。

输入格式

输入包含一行,包含两个整数 $N, M$,分别表示两个骰子的面数。

数据范围

$4 \le N, M \le 20$ 表示面数。

输出格式

输出点数之和出现概率最高的结果;如果有多个结果的概率相同,则必须按从小到大的顺序分行输出。

样例

样例输入 1

6 6

样例输出 1

7

样例输入 2

6 4

样例输出 2

5
6
7

样例输入 3

12 20

样例输出 3

13
14
15
16
17
18
19
20
21

Figure 1. 不同面数的骰子示例

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.