Edward is a worker for Aluminum Cyclic Machinery. His work is operating mechanical arms to cut out designed models. Here is a brief introduction to his work.
Assume the operating plane as a two-dimensional coordinate system. At first, there is a disc with center coordinates (0, 0) and radius R. Then, m mechanical arms will cut and erase everything within its area of influence simultaneously, the i-th area of which is a circle with center coordinates (xi, yi) and radius ri (i = 1, 2, ..., m). In order to obtain considerable models, it is guaranteed that every two cutting areas have no intersection and no cutting area contains the whole disc.
Your task is to determine the perimeter of the remaining area of the disc excluding internal perimeter.
Here is an illustration of the sample, in which the red curve is counted but the green curve is not.
The first line contains one integer T, indicating the number of test cases.
The following lines describe all the test cases. For each test case:
The first line contains two integers m and R.
The i-th line of the following m lines contains three integers xi, yi and ri, indicating a cutting area.
1 ≤ T ≤ 1000, 1 ≤ m ≤ 100, - 1000 ≤ xi, yi ≤ 1000, 1 ≤ R, ri ≤ 1000 (i = 1, 2, ..., m).
For each test case, print the perimeter of the remaining area in one line. Your answer is considered correct if its absolute or relative error does not exceed 10 - 6.
Formally, let your answer be a and the jury's answer be b. Your answer is considered correct if .
## Input
The first line contains one integer T, indicating the number of test cases.The following lines describe all the test cases. For each test case:The first line contains two integers m and R.The i-th line of the following m lines contains three integers xi, yi and ri, indicating a cutting area.1 ≤ T ≤ 1000, 1 ≤ m ≤ 100, - 1000 ≤ xi, yi ≤ 1000, 1 ≤ R, ri ≤ 1000 (i = 1, 2, ..., m).
## Output
For each test case, print the perimeter of the remaining area in one line. Your answer is considered correct if its absolute or relative error does not exceed 10 - 6.Formally, let your answer be a and the jury's answer be b. Your answer is considered correct if .
[samples]
**Definitions**
Let $ T \in \mathbb{Z} $ be the number of test cases.
For each test case:
- Let $ m \in \mathbb{Z} $ be the number of cutting circles.
- Let $ R \in \mathbb{R}^+ $ be the radius of the original disc centered at $ (0,0) $.
- For $ i = 1, \dots, m $, let $ C_i = (x_i, y_i) \in \mathbb{R}^2 $ be the center and $ r_i \in \mathbb{R}^+ $ the radius of the $ i $-th cutting circle.
**Constraints**
1. $ 1 \leq T \leq 1000 $
2. $ 1 \leq m \leq 100 $
3. $ -1000 \leq x_i, y_i \leq 1000 $
4. $ 1 \leq R, r_i \leq 1000 $
5. All cutting circles are pairwise disjoint.
6. No cutting circle contains the entire disc.
**Objective**
Compute the perimeter of the remaining region of the disc after removing the interiors of all cutting circles, counting only the external boundary of the disc and the boundaries of the cutting circles that remain exposed (i.e., internal boundaries between disc and cutouts are counted, but internal boundaries between cutouts are not).
The total perimeter is:
$$
P = 2\pi R + \sum_{i=1}^{m} 2\pi r_i
$$