QOJ.ac

QOJ

时间限制: 15.0 s 内存限制: 1024 MB 总分: 100 可 Hack ✓

#17687. 欧亚合众国

统计

在 5013 年,jh05013 征服了欧亚大陆并建立了“jh land”。“jh land”覆盖了整个大陆,由于其面积巨大且人口众多,jh05013 旨在将该国家划分为多个“地区”以进行高效管理。在“jh land”中有 $N$ 栋房屋,每栋房屋都位于二维笛卡尔坐标系中的 $(x_i, y_i)$ 处。jh05013 在将它们划分为地区时需遵守以下条件:

  • 条件 1:每个地区包含的房屋的 $x$ 坐标都在某个特定范围内。(一个地区可能包含所有房屋,也可能不包含任何房屋)
  • 条件 2:每栋房屋恰好被包含在一个地区中。
  • 条件 3:最多有 $K$ 个地区。

欧亚大陆上有不同的种族、宗教和国家。为了避免冲突,我们必须降低地区的“分裂度”。一个地区的分裂度定义为该地区内最远的一对房屋之间的距离。距离使用欧几里得度量。请帮助 jh05013 最小化所有地区中的最大分裂度。

输入格式

第一行给出两个空格分隔的整数 $N, K$。$N$ 表示房屋的数量,$K$ 表示地区的数量。($1 \le K \le N \le 250,000$)

接下来的 $N$ 行中,每行给出两个空格分隔的整数 $x_i, y_i$。它们表示一栋房屋位于 $(x_i, y_i)$。($0 \le x_i, y_i \le 10^9$) 所有给定的位置都是互不相同的。

输出格式

当所有地区中最大分裂度的最小值为 $M$ 时,输出 $M^2$。

样例

输入样例 1

4 2
101 100
2 5
100 101
4 3

输出样例 1

8

输入样例 2

4 4
3 1
4 1
5 1
9 2

输出样例 2

0

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.