{"raw_statement":[{"iden":"statement","content":"Edward 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.\n\nSuppose 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.\n\nYour 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. e. the least upper bound) of distances between every two points in the subset. Here is an illustration of the sample.\n\nThe 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$.\n\nFor each test case, the first line contains two integers $n$ and $R$, where $1 <= n <= 100$ and $1 <= R <= 1000$.\n\nThe 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 <= x_i, y_i <= 1000$ and $1 <= r_i <= 1000$.\n\nFor each test case, output a line containing \"_Case #x: y_\" (without quotes), where _x_ is the test case number starting from $1$, and _y_ 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's answer is $b$, your answer will be considered correct if $frac(| a -b |, max {1 , | b |}) <= 10^(-9)$, where $max {x, y}$ means the maximum of $x$ and $y$ and $| x |$ means the absolute value of $x$.\n\nIn 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 $(frac(11, 2) -frac(27 sqrt(471), 157), -3 -frac(99 sqrt(471), 314))$.\n\n"},{"iden":"input","content":"The 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$.For each test case, the first line contains two integers $n$ and $R$, where $1 <= n <= 100$ and $1 <= R <= 1000$.The 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 <= x_i, y_i <= 1000$ and $1 <= r_i <= 1000$."},{"iden":"output","content":"For each test case, output a line containing \"_Case #x: y_\" (without quotes), where _x_ is the test case number starting from $1$, and _y_ 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's answer is $b$, your answer will be considered correct if $frac(| a -b |, max {1 , | b |}) <= 10^(-9)$, where $max {x, y}$ means the maximum of $x$ and $y$ and $| x |$ means the absolute value of $x$."},{"iden":"note","content":"In 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 $(frac(11, 2) -frac(27 sqrt(471), 157), -3 -frac(99 sqrt(471), 314))$."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T \\in \\mathbb{Z}^+ $ be the number of test cases.  \nFor each test case:  \n- Let $ R \\in \\mathbb{R}^+ $ be the radius of the original circular mould centered at $ (0, 0) $.  \n- Let $ n \\in \\mathbb{Z}^+ $ be the number of mechanical arms.  \n- For each $ i \\in \\{1, \\dots, n\\} $, let $ C_i = (x_i, y_i) \\in \\mathbb{R}^2 $ be the center and $ r_i \\in \\mathbb{R}^+ $ the radius of the circular affected area of the $ i $-th arm.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 5000 $  \n2. $ 1 \\le n \\le 100 $, $ 1 \\le R \\le 1000 $  \n3. $ -1000 \\le x_i, y_i \\le 1000 $, $ 1 \\le r_i \\le 1000 $  \n4. The affected circles are pairwise disjoint: $ \\forall i \\ne j, \\, \\|C_i - C_j\\| \\ge r_i + r_j $  \n5. No affected circle contains the entire original mould: $ \\forall i, \\, \\|C_i\\| + r_i < R $  \n\n**Objective**  \nLet $ M = \\{ p \\in \\mathbb{R}^2 \\mid \\|p\\| \\le R \\} \\setminus \\bigcup_{i=1}^n \\{ p \\in \\mathbb{R}^2 \\mid \\|p - C_i\\| \\le r_i \\} $ be the residual region.  \nCompute the diameter of $ M $, defined as:  \n$$\n\\sup \\{ \\|p - q\\| \\mid p, q \\in M \\}\n$$","simple_statement":"Edward cuts out circular regions from a circular mold. Find the diameter of the remaining part after all cuts.","has_page_source":false}