QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 256 MB Total points: 100 Hackable ✓

#16114. No Distance is Too Far Apart

الإحصائيات

Alice 和 Bob 站在一个共有 $N$ 个人的疫苗接种队列中(包含他们自己)。由于每个人都戴着口罩并保持距离,几乎无法认出其他人。Alice 数出她前面有 $A$ 个人,而 Bob 数出他后面有 $B$ 个人。

即使他们看不见对方,他们仍然想知道彼此相距多远。你能帮他们算出 Alice 和 Bob 之间站了多少人吗(不包括他们两人)?

输入格式

一行包含三个整数 $N$、$A$ 和 $B$ ($2 \le N \le 1000, 0 \le A, B \le N - 1; A + B \neq N - 1$),分别表示队列中的总人数、Alice 前面的人数以及 Bob 后面的人数。

输出格式

输出一个整数,表示 Alice 和 Bob 之间站的人数。

样例

输入 1

10 2 3

输出 1

3

输入 2

7 4 5

输出 2

2

输入 3

998 244 353

输出 3

399

说明

在第一个样例中,从前到后的队列可以描述为 ooAoooBooo,其中 A 是 Alice 的位置,B 是 Bob 的位置。

在第二个样例中,从前到后的队列可以描述为 oBooAoo,其中 A 是 Alice 的位置,B 是 Bob 的位置。

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.