Nails
Problem
Arash is tired of working hard, so he wants to surround some nails on the wall of his room with a rubber ribbon to make it fun! Now, he wants to know what will be the final length of the rubber ribbon after surrounding the nails. You must assume that the radius of the nails and rubber ribbon is negligible.
Input
The first line of input gives the number of cases, \(N\). \(N\) test cases will follow. Each test case starts with a line containing two integers, the initial length of rubber ribbon and the number of nails \(0 < n ≤ 100\) respectively. Each of next \(n\) lines contains two integers denoting the location of a nail. There will be a blank line after each test-case.
Output
Your program must output the final length of rubber ribbon precise to 5 decimal digits.
Sample
Input
2
2 4
0 0
0 1
1 0
1 1
5 4
0 0
0 1
1 0
1 1
Output
4.00000
5.00000
Comments