QOJ.ac

QOJ

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

#8254. 水位记录

Estadísticas

Eugene 每天都会记录他喝了多少杯水。但他忘记记录其中一天的数据了。不过,他记得自开始记录以来,他每天喝水的杯数的最小值和最大值,并且记得至少有一天他喝的杯数等于这个最小值,至少有一天他喝的杯数等于这个最大值。请计算他忘记记录的那一天可能喝了多少杯水。

输入格式

第一行包含三个整数 $n$ ($2 \le n \le 50$),$a$ 和 $b$ ($1 \le a \le b \le 50$),其中 $n$ 是 Eugene 记录的天数,$a$ 是他某一天喝水杯数的最小值,$b$ 是对应的最大值。

接下来的 $n - 1$ 行,每行包含一个整数 $w$ ($a \le w \le b$)。这些是 Eugene 除了忘记记录的那一天之外,每天的饮水量记录。

输出格式

按升序输出所有可能的缺失记录值,用空格分隔;如果 Eugene 的记忆有误,导致不存在这样的值,则输出 -1。

样例

样例输入 1

5 1 5
1
2
4
5

样例输出 1

1 2 3 4 5

样例输入 2

5 1 5
1
2
3
4

样例输出 2

5

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.