CF1190E.Tokitsukaze and Explosion

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Tokitsukaze and her friends are trying to infiltrate a secret base built by Claris. However, Claris has been aware of that and set a bomb which is going to explode in a minute. Although they try to escape, they have no place to go after they find that the door has been locked.

At this very moment, CJB, Father of Tokitsukaze comes. With his magical power given by Ereshkigal, the goddess of the underworld, CJB is able to set mm barriers to protect them from the explosion. Formally, let's build a Cartesian coordinate system on the plane and assume the bomb is at O(0,0)O(0, 0) . There are nn persons in Tokitsukaze's crew, the ii -th one of whom is at Pi(Xi,Yi)P_i(X_i, Y_i) . Every barrier can be considered as a line with infinity length and they can intersect each other. For every person from Tokitsukaze's crew, there must be at least one barrier separating the bomb and him, which means the line between the bomb and him intersects with at least one barrier. In this definition, if there exists a person standing at the position of the bomb, any line through O(0,0)O(0, 0) will satisfy the requirement.

Although CJB is very powerful, he still wants his barriers to be as far from the bomb as possible, in order to conserve his energy. Please help him calculate the maximum distance between the bomb and the closest barrier while all of Tokitsukaze's crew are safe.

输入格式

The first line contains two integers nn , mm ( 1n,m1051 \leq n, m \leq 10^5 ), indicating the number of people and the number of barriers respectively.

The ii -th line of the next nn lines contains two integers XiX_i , YiY_i ( 105Xi,Yi105-10^5 \leq X_i, Y_i \leq 10^5 ), indicating the ii -th person's location Pi(Xi,Yi)P_i(X_i, Y_i) . Note that PiP_i may have the same coordinates as PjP_j ( jij \neq i ) or even OO .

输出格式

Print a single real number — the maximum distance meeting the requirement. Your answer is considered correct if its absolute or relative error does not exceed 10610^{-6} .

Formally, let your answer be aa , and the jury's answer be bb . Your answer is accepted if and only if abmax(1,b)106\frac{|a - b|}{\max(1, |b|)} \leq 10^{-6} .

输入输出样例

  • 输入#1

    3 1
    2 0
    0 2
    -1 0
    

    输出#1

    0.0000000000
    
  • 输入#2

    1 1
    0 0
    

    输出#2

    0.0000000000
    
  • 输入#3

    2 1
    -1 -1
    -1 -1
    

    输出#3

    1.4142135617
    
  • 输入#4

    3 100000
    3 2
    -1 -3
    2 -5
    

    输出#4

    3.1622776602
    

说明/提示

In the first two examples, CJB must set the barrier crossing O(0,0)O(0, 0) .

In the last two examples, CJB can set each barrier crossing some PiP_i such that the barrier is perpendicular to the line between PiP_i and OO .

首页