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 m 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) . There are n persons in Tokitsukaze's crew, the i -th one of whom is at Pi(Xi,Yi) . 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) 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 n , m ( 1≤n,m≤105 ), indicating the number of people and the number of barriers respectively.
The i -th line of the next n lines contains two integers Xi , Yi ( −105≤Xi,Yi≤105 ), indicating the i -th person's location Pi(Xi,Yi) . Note that Pi may have the same coordinates as Pj ( j=i ) or even O .
输出格式
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 10−6 .
Formally, let your answer be a , and the jury's answer be b . Your answer is accepted if and only if max(1,∣b∣)∣a−b∣≤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) .
In the last two examples, CJB can set each barrier crossing some Pi such that the barrier is perpendicular to the line between Pi and O .