Logo
(追記) (追記ここまで)

15126번 - Move Away 다국어

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

문제

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

힌트

출처

ICPC > Regionals > North America > Southeast USA Regional > 2017 Southeast USA Regional Programming Contest > Division 1 F번

ICPC > Regionals > North America > Southeast USA Regional > 2017 Southeast USA Regional Programming Contest > Division 2 F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /