CF744D.Hongcow Draws a Circle

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Hongcow really likes the color red. Hongcow doesn't like the color blue.

Hongcow is standing in an infinite field where there are nn red points and mm blue points.

Hongcow wants to draw a circle in the field such that this circle contains at least one red point, and no blue points. Points that line exactly on the boundary of the circle can be counted as either inside or outside.

Compute the radius of the largest circle that satisfies this condition. If this circle can have arbitrarily large size, print 1-1 . Otherwise, your answer will be accepted if it has relative or absolute error at most 10410^{-4} .

输入格式

The first line of the input will contain two integers n,mn,m ( 1<=n,m<=1,0001<=n,m<=1,000 ).

The next nn lines will contain two integers xi,yix_{i},y_{i} ( 1<=xi,yi<=1041<=x_{i},y_{i}<=10^{4} ). This denotes the coordinates of a red point.

The next mm lines will contain two integers xi,yix_{i},y_{i} ( 1<=xi,yi<=1041<=x_{i},y_{i}<=10^{4} ). This denotes the coordinates of a blue point.

No two points will have the same coordinates.

输出格式

Print 1-1 if the circle can have arbitrary size. Otherwise, print a floating point number representing the largest radius circle that satisfies the conditions. Your answer will be considered correct if its absolute or relative error does not exceed 10410^{-4} .

Namely, let's assume that your answer is aa and the answer of the jury is bb . The checker program will consider your answer correct if .

输入输出样例

  • 输入#1

    2 5
    2 3
    3 4
    1 1
    1 4
    4 2
    4 7
    2 5
    

    输出#1

    3.5355338827
    
  • 输入#2

    1 6
    3 3
    1 5
    5 4
    2 1
    3 4
    4 2
    1 3
    

    输出#2

    1.5811388195
    
  • 输入#3

    2 2
    2 2
    3 3
    1 1
    4 4
    

    输出#3

    -1
    

说明/提示

This is a picture of the first sample

This is a picture of the second sample

首页