{"problem":{"name":"D. Hongcow Draws a Circle","description":{"content":"Hongcow really likes the color red. Hongcow doesn't like the color blue. Hongcow is standing in an infinite field where there are _n_ red points and _m_ blue points. Hongcow wants to draw a circle i","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":6000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF744D"},"statements":[{"statement_type":"Markdown","content":"Hongcow really likes the color red. Hongcow doesn't like the color blue.\n\nHongcow is standing in an infinite field where there are _n_ red points and _m_ blue points.\n\nHongcow 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.\n\nCompute the radius of the largest circle that satisfies this condition. If this circle can have arbitrarily large size, print  - 1. Otherwise, your answer will be accepted if it has relative or absolute error at most 10 - 4.\n\n## Input\n\nThe first line of the input will contain two integers _n_, _m_ (1 ≤ _n_, _m_ ≤ 1, 000).\n\nThe next _n_ lines will contain two integers _x__i_, _y__i_ (1 ≤ _x__i_, _y__i_ ≤ 104). This denotes the coordinates of a red point.\n\nThe next _m_ lines will contain two integers _x__i_, _y__i_ (1 ≤ _x__i_, _y__i_ ≤ 104). This denotes the coordinates of a blue point.\n\nNo two points will have the same coordinates.\n\n## Output\n\nPrint  - 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 10 - 4.\n\nNamely, let's assume that your answer is _a_ and the answer of the jury is _b_. The checker program will consider your answer correct if .\n\n[samples]\n\n## Note\n\nThis is a picture of the first sample\n\n<center>![image](https://espresso.codeforces.com/0f675fac46c5f415b535b330fa4e32d705e821fc.png)</center>This is a picture of the second sample\n\n<center>![image](https://espresso.codeforces.com/c476ce278477483fa5a8c860aa9f9cdc29de3f56.png)</center>","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"Hongcow 非常喜欢红色。Hongcow 不喜欢蓝色。\n\nHongcow 站在一个无限的场地上，场地上有 #cf_span[n] 个红点和 #cf_span[m] 个蓝点。\n\nHongcow 希望在场地上画一个圆，使得这个圆包含至少一个红点，且不包含任何蓝点。恰好位于圆边界上的点可以被算作在圆内或圆外。\n\n计算满足该条件的最大圆的半径。如果这样的圆可以具有任意大的尺寸，请输出 #cf_span[ - 1]。否则，你的答案只要相对误差或绝对误差不超过 #cf_span[10 - 4] 即可被接受。\n\n输入的第一行包含两个整数 #cf_span[n, m] (#cf_span[1 ≤ n, m ≤ 1, 000])。\n\n接下来的 #cf_span[n] 行，每行包含两个整数 #cf_span[xi, yi] (#cf_span[1 ≤ xi, yi ≤ 104])，表示一个红点的坐标。\n\n接下来的 #cf_span[m] 行，每行包含两个整数 #cf_span[xi, yi] (#cf_span[1 ≤ xi, yi ≤ 104])，表示一个蓝点的坐标。\n\n任意两点的坐标均不相同。\n\n如果圆的尺寸可以任意大，请输出 #cf_span[ - 1]；否则，输出一个浮点数，表示满足条件的最大半径圆的半径。你的答案若绝对误差或相对误差不超过 #cf_span[10 - 4]，则会被视为正确。\n\n设你的答案为 #cf_span[a]，标准答案为 #cf_span[b]，评测程序将认为你的答案正确当且仅当 。\n\n这是第一个样例的图示 \n\n这是第二个样例的图示 \n\n## Input\n\n输入的第一行包含两个整数 #cf_span[n, m] (#cf_span[1 ≤ n, m ≤ 1, 000])。接下来的 #cf_span[n] 行，每行包含两个整数 #cf_span[xi, yi] (#cf_span[1 ≤ xi, yi ≤ 104])，表示一个红点的坐标。接下来的 #cf_span[m] 行，每行包含两个整数 #cf_span[xi, yi] (#cf_span[1 ≤ xi, yi ≤ 104])，表示一个蓝点的坐标。任意两点的坐标均不相同。\n\n## Output\n\n如果圆的尺寸可以任意大，请输出 #cf_span[ - 1]；否则，输出一个浮点数，表示满足条件的最大半径圆的半径。你的答案若绝对误差或相对误差不超过 #cf_span[10 - 4]，则会被视为正确。设你的答案为 #cf_span[a]，标准答案为 #cf_span[b]，评测程序将认为你的答案正确当且仅当 。\n\n[samples]\n\n## Note\n\n这是第一个样例的图示   这是第二个样例的图示","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"Let $ R = \\{ r_1, r_2, \\dots, r_n \\} \\subset \\mathbb{R}^2 $ be the set of red points, and $ B = \\{ b_1, b_2, \\dots, b_m \\} \\subset \\mathbb{R}^2 $ be the set of blue points.\n\nWe seek the maximum radius $ r \\geq 0 $ such that there exists a circle $ C $ with radius $ r $ and center $ c \\in \\mathbb{R}^2 $ satisfying:\n\n- $ \\exists \\, r_i \\in R $ such that $ \\| c - r_i \\| \\leq r $,\n- $ \\forall \\, b_j \\in B $, $ \\| c - b_j \\| \\geq r $,\n\nwhere equality in distance is allowed (boundary points may be considered inside or outside).\n\nIf such a circle exists with arbitrarily large radius, output $ -1 $.\n\nOtherwise, compute:\n\n$$\n\\max \\left\\{ r \\geq 0 \\,\\middle|\\, \\exists c \\in \\mathbb{R}^2 : \\min_{r_i \\in R} \\|c - r_i\\| \\leq r \\leq \\min_{b_j \\in B} \\|c - b_j\\| \\right\\}\n$$\n\nEquivalently, define:\n\n$$\n\\mathcal{C} = \\left\\{ c \\in \\mathbb{R}^2 \\,\\middle|\\, \\min_{r_i \\in R} \\|c - r_i\\| \\leq \\min_{b_j \\in B} \\|c - b_j\\| \\right\\}\n$$\n\nThen:\n\n$$\nr^* = \\sup_{c \\in \\mathcal{C}} \\min_{r_i \\in R} \\|c - r_i\\|\n$$\n\nIf $ \\mathcal{C} $ is unbounded and $ \\min_{b_j \\in B} \\|c - b_j\\| \\to \\infty $ as $ \\|c\\| \\to \\infty $ while $ \\min_{r_i \\in R} \\|c - r_i\\| $ remains bounded, then $ r^* = \\infty $, output $ -1 $.\n\nOtherwise, $ r^* $ is finite and equals the maximum radius of a circle containing at least one red point and avoiding all blue points (with boundary tolerance).","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF744D","tags":["geometry"],"sample_group":[["2 5\n2 3\n3 4\n1 1\n1 4\n4 2\n4 7\n2 5","3.5355338827"],["1 6\n3 3\n1 5\n5 4\n2 1\n3 4\n4 2\n1 3","1.5811388195"],["2 2\n2 2\n3 3\n1 1\n4 4","\\-1"]],"created_at":"2026-03-03 11:00:39"}}