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

32497번 - Bikes and Barricades 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB83575367.949%

문제

Scott wants to ride his bike along a straight road. But the road has some barricades! Scott will ride his bike up to the first barricade and stop.

Model Scott’s straight road as the positive $Y$ axis, with Scott starting at the origin. The barricades are line segments, specified by their endpoints. Determine how far Scott can ride, or if his path is completely unobstructed.

입력

The first line of input contains a single integer $n$ (1ドル≤n≤1,000円$), which is the number of barricades.

Each of the next nn lines contains four integers $x_1,ドル $y_1,ドル $x_2$ and $y_2$ ($-100≤x_1,y_1,x_2,y_2≤100,ドル $x_1 \ne 0,ドル $x_2 \ne 0$), representing a barricade that runs from $(x_1,y_1)$ to $(x_2,y_2)$. It is guaranteed that no barricade will run through the origin.

출력

Output a single real number, which is how far Scott can ride before he hits the closest barricade, or $-1.0$ if no barricades get in Scott’s way. This output will be considered correct if it is within an absolute or relative error of 10ドル^{-2}$.

제한

예제 입력 1

2
-10 7 5 19
-1 -1 8 21

예제 출력 1

1.4444444444444446

예제 입력 2

2
4 -6 -12 -1
3 5 8 8

예제 출력 2

-1.0

힌트

출처

ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2024 B번

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

출처

대학교 대회

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

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