QOJ.ac

QOJ

حد الوقت: 2.0 s حد الذاكرة: 1024 MB مجموع النقاط: 100

#14698. Deep800080

الإحصائيات

名为 Deep800080 的船的主人 Ian 今天傍晚准备在湖上举行烧烤。有一条狭窄且笔真的码头从湖岸延伸到湖中。Ian 认为在码头的某个地方进行烧烤会是个好主意。

他想测试他新买的特制烧烤木炭。这种木炭燃烧时会产生一种独特的浓厚紫色烟雾,并在水面上扩散。烟雾云保证会以烧烤地点为中心,呈完美的圆形向外扩散。最终,烟雾云会达到某个最大半径,并在当晚接下来的时间里保持不变,直到深夜散去。

湖中停泊着多艘船只,它们与码头的距离各不相同。Ian 想要通知这些船上的船员关于烧烤的消息。由于有点懒,他希望烧烤的烟雾能帮他完成这项工作。Ian 希望当烟雾云到达一艘船时,船员们能闻到烟雾,从而立刻知道附近有烧烤。

Ian 想要最大化被通知到的船员数量,因此他希望在码头上选择一个烧烤架的位置,以最大化被紫色烟雾云覆盖的船只数量。

你可以假设湖上的船只都牢牢地锚定着,在烟雾云笼罩湖面期间不会移动。此外,一旦选定了烧烤地点,其位置在整个活动期间保持固定。

输入格式

第一行包含四个整数 $N, R, A, B$($0 \le N \le 3 \cdot 10^5$;$1 \le R \le 10^6$)。$N$ 是湖上船只的数量,$R$ 是紫色烧烤烟雾云的最大半径。你可以假设码头非常狭窄且非常长,以至于可以将其视为一条穿过坐标为 $(0, 0)$ 和 $(A, B)$ 的两个不同点的直线。

接下来的 $N$ 行,每行包含两个整数 $X$ 和 $Y$,描述湖上一艘船的坐标。没有两艘船具有相同的坐标。

所有坐标均为平面直角坐标系中的普通坐标,其绝对值最大为 $10^6$。

输出格式

输出紫色烧烤烟雾云能够覆盖的最大船只数量。

如果一艘船的位置在烟雾云形成的圆内(包括边界上),则认为该船被覆盖。你可以假设将烟雾云的最大半径增加 $10^{-3}$ 不会改变答案。

样例

输入样例 1

7 5 0 1
-1 -1
1 -1
0 0
2 3
3 4
10 10
2 12

输出样例 1

5

输入样例 2

3 1 1 0
0 0
2 0
4 0

输出样例 2

2

输入样例 3

4 1 1 0
0 0
1 1
1 -1
2 0

输出样例 3

4

图 1:样例输入 1(左)、样例输入 2(右上)和样例输入 3(右下)的可能解

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.