|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||5||0||0||0.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.
4 1 0 1 0 1 1 -1 0 1 0 -1 1
2 -1 0 1000 2 0 1000