{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"cocktail 最近在切割圆台。假定他的操作平面是一个带有坐标系的欧式平面。\n\n最开始会有一个圆形的模具,它的中心在 `(0,0)`,半径为 `R`。\n\n接下来他会操作 `n` 次,其中第 `i` 次以 (x\u003csub\u003ei\u003c/sub\u003e, y\u003csub\u003ei\u003c/sub\u003e) 为圆心,半径 r\u003csub\u003ei\u003c/sub\u003e,他会切掉模具在这个区域内的部分。为了让自己操作方便,他保证每次切割的部分不会相交,并且不会有一次的影响区域包含整个模具。\n\n你现在需要计算剩余部分的直径。这里,欧式平面上点集的直径(可能不是凸的)是子集中每两个点之间的距离的上确界即最小上界。以下是样例的示意图。\n\n\u003ccenter\u003e \n \u003cimg class\u003d\"tex-graphics\" SRC\u003d\"CDN_BASE_URL/34cc8a31381c92153eda5a6ace5f147c?v\u003d1565582253\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \n\u003c/center\u003e"}},{"title":"输入","value":{"format":"MD","content":"输入包含多组测试用例,第一行包含数字 `T` 表示测试用例数,并且 T ≤ 5000。\n\n对于每组测试样例,第一行包含两个数字 `n` 和 `R`,其中 1 ≤ n ≤ 100, 1 ≤ R ≤ 1000。\n\n接下来 n 行表述了多个由机械臂切割下来的区域,每行包括三个数字 x\u003csub\u003ei\u003c/sub\u003e, y\u003csub\u003ei\u003c/sub\u003e, r\u003csub\u003ei\u003c/sub\u003e,其中 -1000 ≤ x\u003csub\u003ei\u003c/sub\u003e, y\u003csub\u003ei\u003c/sub\u003e ≤ 1000, 1 ≤ r\u003csub\u003ei\u003c/sub\u003e ≤ 1000。"}},{"title":"输出","value":{"format":"MD","content":"对于每组测试样例,输出一行包括 `Case #x: y`,其中x为从1开始的测试用例编号,y为剩余区域的直径,要求相对误差和绝对误差不超过 10\u003csup\u003e-9\u003c/sup\u003e。"}},{"title":"样例输入","value":{"format":"MD","content":"```\n1\n3 10\n0 12 10\n11 -6 10\n-11 -6 10\n```"}},{"title":"样例输出","value":{"format":"MD","content":"```\nCase #1: 18.611654895000252\n```"}},{"title":"提示","value":{"format":"MD","content":"对于样例而言,剩余部分的直径为 sqrt(324 + 162 sqrt(471) / 157) ≈ 18.611654895000253,即 `(8, 6)` 和 `(11 / 2 - 27 sqrt(471) / 157, -3 - 99 sqrt(471) / 314)` 之间的距离。"}}]}