QOJ.ac

QOJ

Limite de temps : 15 s Limite de mémoire : 1024 MB Points totaux : 100

#2165. 地脉线

Statistiques

1921 年,业余考古学家 Alfred Watkins 创造了“ley lines”(地脉线)一词,用来指代连接众多具有地理和历史意义地点的直线。这些线条通常与神秘主义理论联系在一起,其中许多理论至今仍然存在。

对地脉线的一种常见批评是,人们在地图上画出的线条实际上具有非零的宽度。给定足够的点密度和足够粗的铅笔,找到连接多个地点的“线条”是微不足道的。在这个问题中,你将探讨这一批评。

为简化起见,我们将忽略地球的曲率,假设我们处理的是平面上的一组点,每个点都有唯一的 $(x, y)$ 坐标,且其中任意三点都不在同一条直线上。给定这样一组点以及铅笔的厚度,你能画出一条穿过点的最大数量是多少?

输入格式

输入的第一行包含两个整数 $n$ 和 $t$,其中 $n$ ($3 \le n \le 3\,000$) 是点集中的点数,$t$ ($0 \le t \le 10^9$) 是铅笔的厚度。接下来有 $n$ 行,每行包含两个整数 $x$ 和 $y$ ($-10^9 \le x, y \le 10^9$),表示点集中的一个点的坐标。

你可以假设输入满足以下条件:如果厚度 $t$ 增加或减少 $10^{-2}$,答案不会改变,且输入中没有三点共线。

输出格式

输出穿过一条厚度为 $t$ 的“直线”所能覆盖的点的最大数量。

样例

样例输入 1

4 2
0 0
2 4
4 9
3 1

样例输出 1

3

样例输入 2

3 1
0 10
2000 10
1000 12

样例输出 2

2

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.