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

34777번 - Investigating Quadradômeda 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.5 초 2048 MB111100.000%

문제

The Society for Beyond-Earth Cosmonautics (SBC) is training its teams for the next edition of the International Challenge of Planetary Cosmonautics (ICPC).

SBC will conduct a simulated exploration of a distant galaxy called Quadrameda. For this mission, $N$ stars were selected for their geometrically strategic locations, and a visitation order was determined, numbered from 1ドル$ to $N$. To prepare the teams, simplified models are used, in which each star is represented by a point in the plane with integer coordinates $(x_i , y_i)$.

The stars are arranged so that, for each 1ドル ≤ i < N,ドル star $i$ is aligned with star $i + 1,ドル that is, they share the same $x$ coordinate or the same $y$ coordinate.

The mission’s objective is to orbit each star $i$ along a circle of constant integer radius $R_i ≥ 1$. During the simulation, the spacecraft orbits the current star and, upon reaching the point of the orbit closest to the next star, leaves this orbit and immediately begins orbiting the following star. For this maneuver to be possible, for each 1ドル ≤ i < N,ドル the radius $R_i$ must be strictly less than the Euclidean distance between stars $i$ and $i + 1$.

The example below illustrates a valid orbit configuration with $N = 3$; the stars are at the points $(0, 0),ドル $(4, 0)$ and $(4, 4)$. In this configuration, we have $R_1 = 1,ドル $R_2 = 3$ and $R_3 = 1$.

Your task is to determine the largest integer value of $R_1$ such that it is possible to choose values $R_1, R_2, \dots , R_N$ that satisfy all the conditions above. If no valid orbit configuration exists, report that the mission is impossible.

입력

The first line contains an integer $N$ (2ドル ≤ N ≤ 10^5$), the number of stars.

Each of the next $N$ lines contains two integers $x_i$ and $y_i$ ($|x_i |, |y_i | ≤ 10^9$), the coordinates of star $i$. For each 1ドル ≤ i < N,ドル stars $i$ and $i + 1$ are aligned horizontally or vertically.

출력

Your program should produce a single line containing the largest integer value of $R_1$ such that a valid orbit configuration exists, or -1 if the mission is impossible.

제한

예제 입력 1

3
0 0
4 0
4 4

예제 출력 1

3

예제 입력 2

5
0 0
4 0
4 2
4 6
6 6

예제 출력 2

-1

예제 입력 3

4
0 0
4 0
4 4
4 7

예제 출력 3

2

노트

출처

ICPC > Regionals > Latin America > Sub-Regional Brasil do ACM ICPC > Maratona SBC de Programação 2025 I번

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

출처

대학교 대회

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

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