{"trustable":true,"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":"HTML","content":"\u003cp\u003eEdward is a worker for Aluminum Cyclic Machinery. His work is to control the mechanical arms to cut out some parts of the mould material. Here is a brief introduction to his work.\u003c/p\u003e\u003cp\u003eSuppose the operation panel for him is a Euclidean plane with the coordinate system. Originally the mould is a disc whose centre coordinates is $$$(0, 0)$$$ and of radius $$$R$$$. Edward controls $$$n$$$ different mechanical arms to cut out and erase those all of the mould within their affected areas. The affected area of the $$$i$$$-th mechanical arm is a circle whose centre coordinate is $$$(x_i, y_i)$$$ and of radius $$$r_i$$$. In order to obtain the highly developed product, it is guaranteed that the affected areas of any two mechanical arms share no intersection and no one has an affected area containing the whole original mould.\u003c/p\u003e\u003cp\u003eYour task is to determine the diameter of the residual mould. Here the diameter of a subset, which may not be convex, over the Euclidean plane is the supremum (i.\u0026nbsp;e. the least upper bound) of distances between every two points in the subset. Here is an illustration of the sample.\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/dded889efab99c32023f14e3345c2154?v\u003d1715650715\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input contains several test cases, and the first line contains a positive integer $$$T$$$ indicating the number of test cases which is up to $$$5000$$$.\u003c/p\u003e\u003cp\u003eFor each test case, the first line contains two integers $$$n$$$ and $$$R$$$, where $$$1 \\le n \\le 100$$$ and $$$1 \\le R \\le 1000$$$.\u003c/p\u003e\u003cp\u003eThe following $$$n$$$ lines describe all mechanical arms controlled by Edward, the $$$i$$$-th of which contains three integers $$$x_i, y_i$$$ and $$$r_i$$$ describing the affected area of the $$$i$$$-th mechanical arm, where $$$-1000 \\le x_i, y_i \\le 1000$$$ and $$$1 \\le r_i \\le 1000$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, output a line containing \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eCase #x: y\u003c/span\u003e\" (without quotes), where \u003cspan class\u003d\"tex-font-style-tt\"\u003ex\u003c/span\u003e is the test case number starting from $$$1$$$, and \u003cspan class\u003d\"tex-font-style-tt\"\u003ey\u003c/span\u003e is the diameter of the remaining area with an absolute or relative error of at most $$$10^{-9}$$$. Precisely speaking, assume that your answer is $$$a$$$ and and the jury\u0027s answer is $$$b$$$, your answer will be considered correct if $$$\\frac{|a - b|}{\\max\\{1, |b|\\}} \\le 10^{-9}$$$, where $$$\\max\\{x, y\\}$$$ means the maximum of $$$x$$$ and $$$y$$$ and $$$|x|$$$ means the absolute value of $$$x$$$.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\n3 10\n0 12 10\n11 -6 10\n-11 -6 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 18.611654895000252\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the sample case, the diameter of the remaining area is $$$\\sqrt{324 + \\frac{162 \\sqrt{471}}{157}} \\approx 18.611654895000253$$$, which is equal to the distance between $$$(-8, 6)$$$ and $$$\\left(\\frac{11}{2} - \\frac{27 \\sqrt{471}}{157}, -3 - \\frac{99 \\sqrt{471}}{314}\\right)$$$.\u003c/p\u003e"}}]}