Yet Another Point Searching Problem

시간 제한1초메모리 제한1024 MB

요약
주어진 각 점까지의 가중 유클리드 거리의 최댓값이 최소가 되는 점 B를 찾는다.
난이도

어려움10점 중 8점

유형
기하, 이분 탐색, 수학
정답자
아직 제출이 없습니다

문제

You are given nn points on the plane: A_1,A_2,⋯ ,A_nA\_1, A\_2, \cdots, A\_n. Point ii has weight w_iw\_i. Find such point BB that the maximum weighted distance max⁡_i=1nw_i⋅∣A_iB∣\max\limits\_{i=1}^{n}{w\_i \cdot |A\_{i}B|} is minimal possible.

입력

The input consists of one or more test cases.

On the first line of each test case, there is an integer nn: the number of points (1≤n≤500,0001 \le n \le 500\\,000). Each of the next nn lines contains three integers: x_ix\_i, y_iy\_i and w_iw\_i. Each of these numbers does not exceed 10710^7 by absolute value. All weights are strictly positive.

The test cases follow one another without any gaps. The input is terminated by a line containing a single integer 00. This line must not be considered a test case. The sum of all nn in the input does not exceed 500,000500\\,000. There are no more than 10001000 test cases in the input.

출력

For each test case, print two real numbers: the coordinates of point BB. Your answer will be considered correct if the absolute or relative error of the maximum weighted distance will be less than 10−910^{-9}.

예제1

  1. 예제 1

    입력
    2
    2 2 1
    0 0 1
    3
    0 0 1
    6 0 2
    0 6 3
    0
    
    예상 출력
    1.0 1.0
    2.4 3.6