QOJ.ac

QOJ

时间限制: 1 s 内存限制: 1024 MB 总分: 100

#3196. 贿赂 Eve

统计

Eve 在一家杂志社工作,负责撰写产品评论并向消费者发布推荐。他们正在进行一项新的手机测评,并决定通过两项可重复的测试来评估每款设备的电池寿命和性能,每项测试的分数都在 1 到 1000 之间。

这两个分数 $x_1$ 和 $x_2$ 随后会与权重向量 $w = [w_1, w_2]$ 结合,产生一个总分:

$$s = w_1x_1 + w_2x_2$$

最终的排名通过将产品按 $s$ 的降序排列得出。此外,当多个产品的得分完全相同时,由 Eve 决定它们的排序。

Maria(为了掩盖身份而使用的假名)试图贿赂 Eve 以调整结果,从而使她的产品在榜单上排名更高。Eve 辩称她无法篡改每项测试的评估结果,但 Maria 建议调整计算总分时使用的权重 $w$。权重 $w$ 必须是非负的,且至少有一个必须为正,但具体数值由 Eve 决定。

Eve 正在考虑是否要为了 Maria 的利益而修改权重,并要求你确定 Maria 的产品在最好和最坏情况下的排名。

任务

给定所有产品的电池和性能测试分数 $[x_1, x_2]$,找出当权重 $[w_1, w_2]$ 以及平局时的排序方式由 Eve 决定时,Maria 的产品所能获得的最好和最坏排名。

输入格式

第一行包含一个数字 $N$,表示产品的数量。接下来的 $N$ 行,每行包含两个整数 $x_1$ 和 $x_2$,表示一款产品在电池和性能测试中的分数。Maria 的产品在列表的第一位。

数据范围

$1 \le N \le 100\,000$ $1 \le x_1, x_2 \le 1\,000$

输出格式

输出两个数字 $A$ 和 $B$,分别表示在 Eve 可以修改权重并决定平局排序的情况下,Maria 的产品在排名中可能获得的最好和最坏位置。

样例

输入 1

5
7 7
11 10
8 5
1 1
12 12

输出 1

3 4

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.