Nice Lines
시간 제한0.2초메모리 제한1024 MB
주어진 N개 직선까지의 유클리드 거리 합을 최소로 하는 점을, 그 합을 계산하는 장치를 적게 써서 찾는 문제.
문제
Roxette the pirate princess has arrived to the secret island in the Remeian archipelago. There, a famous treasure, the golden nice lines is rumoured to be buried.
The secret island is a square, by meters long and tall. Any point on the island is described using Cartesian coordinates, with being at the center, and the two axes being parallel to its sides.
There are golden nice lines buried on the island. The th one for occupies the set of all real-valued points described by the linear equation .
Roxette can use a special device, called a lineometer. Given any point on the island, the lineometer will compute the sum of the distances1 from point to each of the golden nice lines.
Unfortunately, the lineometer has a limited number of uses. Can you help Roxette find the treasure with a small enough number of lineometer uses?
1The Euclidean distance between a point and a line is the length of the shortest line segment that touches both the line and the point.
제한
- No two lines are parallel.