QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 512 MB 満点: 100

#3634. 经典隔离

統計

由于全球新冠疫情(COVID-19)的影响,国家民防总部发布了一系列旨在防止病毒在人群中进一步传播的指导方针和建议。其中一项方针涉及在所有餐饮场所(包括小酒馆)强制佩戴防护口罩。

一家当地小酒馆的门上立即贴出了“必须佩戴口罩!!!”的告示。然而,由于这仅仅是指导方针,小酒馆的老板无法强迫顾客佩戴口罩。他们注意到,目前酒馆里有 $a$ 个人佩戴口罩,有 $b$ 个人不佩戴口罩。他们还知道,在接下来的晚上,还会有 $n$ 个人进入酒馆。凭借对人性的深刻理解以及对自己顾客的了解,老板们能够极其精确地推断出:第 $i$ 位新来的顾客佩戴口罩,当且仅当酒馆在他们进入之前是空的,或者酒馆里佩戴口罩的人数占比至少为 $p_i\%$。

不幸的是,老板们不知道顾客进入酒馆的顺序,但他们知道没有人会离开。因此,他们想知道在所有 $n$ 位顾客进入后,酒馆里佩戴口罩的人数最少是多少,最多是多少。

输入格式

第一行包含两个整数 $a$ 和 $b$ ($0 \le a, b \le 10^9$)。

第二行包含一个自然数 $n$ ($1 \le n \le 500\,000$)。

接下来的 $n$ 行中,第 $i$ 行包含一个实数 $p_i$ ($0 \le p_i \le 100$)。每个 $p_i$ 都保留两位小数,并紧跟一个字符 '%' (ASCII 37)。

输出格式

在一行中输出两个整数,分别表示所有 $n$ 位顾客进入后,酒馆里佩戴口罩的人数的最少值和最大值。

样例

样例输入 1

5 5
1
51.05%

样例输出 1

5 5

样例输入 2

4 6
2
0.00%
45.00%

样例输出 2

5 6

样例输入 3

11 19
6
96.47%
30.66%
77.61%
26.20%
36.54%
60.57%

样例输出 3

13 14

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.