시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB611100.000%

문제

Tommy has just completed college and is looking for his first job. A priority in his life is living close to his friends, but he wants to live as far away from his parents as possible.

You are given the locations of Tommy's friends and the maximum distance he would be willing to live away from each friend. You also know that Tommy's parents live at (0, 0) in the coordinate plane. Determine how far Tommy can live from his parents. (There will always be at least one point meeting these requirements.)

입력

Each input will consist of a single test case. Note that your program may be run multiple times on different inputs. Each test case will begin with a line with a single integer n (1 ≤ n ≤ 50), representing the number of friends Tommy has. The next n lines will each contain three integers: x, y (-1,000 ≤ x, y ≤ 1,000) and d (1 ≤ d ≤ 1,000), representing the (x, y) coordinate of his friend and the maximum distance d he is willing to live away from that friend. 

출력

Output a single decimal number on a single line, equal to the maximum distance he can live from his parents while still being close enough to all of his friends. Output this number to exactly 3 decimal places, rounded.

예제 입력 1

4
1 0 1
0 1 1
-1 0 1
0 -1 1

예제 출력 1

0.000

예제 입력 2

2
-1 0 1000
2 0 1000

예제 출력 2

999.999