CF314D.Sereja and Straight Lines

省选/NOI-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Sereja placed n points on a plane. Now Sereja wants to place on the plane two straight lines, intersecting at a right angle, so that one of the straight lines intersect the Ox axis at an angle of 45 degrees and the maximum distance from the points to the straight lines were minimum.

In this problem we consider the distance between points (_x_1, _y_1) and (_x_2, _y_2) equal |_x_1 - _x_2| + |_y_1 - _y_2|. The distance between the point and the straight lines is the minimum distance from the point to some point belonging to one of the lines.

Help Sereja, find the maximum distance from the points to the optimally located straight lines.

谢列亚在平面上放置了 nn 个点。现在谢列亚希望在平面上放置两条互相垂直的直线,其中一条直线与 OxOx 轴成 45∘45^\circ 角,使得所有点到这两条直线的最大距离最小。

本题中,点 (x1,y1)(x_1, y_1) 与 (x2,y2)(x_2, y_2) 之间的距离定义为 ∣x1−x2∣+∣y1−y2∣|x_1 - x_2| + |y_1 - y_2|。点到两条直线的距离定义为该点到两条直线上任意一点的最小距离。

请帮助谢列亚,求出所有点到最优放置的两条直线的最大距离。

输入格式

The first line contains integer n (1 ≤ n ≤ 105). Next n lines contain the coordinates of the lines. The i-th line contains two integers x__i, y__i (|x__i|, |y__i| ≤ 109).

第一行包含一个整数 nn(1≤n≤1051 \leq n \leq 10^5)。接下来的 nn 行包含各条直线的坐标。第 ii 行包含两个整数 xix_i、yiy_i(∣xi∣,∣yi∣≤109|x_i|, |y_i| \leq 10^9)。

输出格式

In a single line print a real number — the answer to the problem. Your answer will be considered correct iff its absolute or relative error doesn't exceed 10 - 6.

在一行中输出一个实数——该问题的答案。当且仅当你的答案的绝对误差或相对误差不超过 10−610^{-6} 时,才被视为正确。

输入输出样例

  • 输入#1

    4
    0 0
    2 0
    0 2
    2 2

    输出#1

    0.000000000000000
  • 输入#2

    4
    1 0
    0 1
    2 1
    1 2

    输出#2

    1.000000000000000

输入解题思路,AI测评打分。不知道怎么写?

首页