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

16410번 - Goat Rope 스페셜 저지다국어

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

문제

You have a fence post located at the point (x, y) in the plane, to which a goat is tethered by a rope. You also have a house, which you model as an axis-aligned rectangle with diagonally opposite corners at the points (x1, y1) and (x2, y2). You want to pick a length of rope that guarantees the goat cannot reach the house. Determine the minimum distance from the fence post to the house, so that you can make sure to use a shorter rope.

입력

The input consists of a single line containing six space-separated integers x, y, x1, y1, x2, and y2, each in the range [−999, 999].

It is guaranteed that x1 < x2 and y1 < y2, and that (x, y) is strictly outside the axis-aligned rectangle with corners at (x1, y1) and (x2, y2).

출력

Print the minimum distance from the goat’s post to the house, with a relative or absolute error no more than 0.001.

제한

예제 입력 1

7 3 0 0 5 4

예제 출력 1

2.0

예제 입력 2

6 0 0 2 7 6

예제 출력 2

2.0

예제 입력 3

3 -4 -3 -1 -1 2

예제 출력 3

5.0

예제 입력 4

7 4 0 0 5 4

예제 출력 4

2.000

예제 입력 5

4 8 7 8 9 9

예제 출력 5

3.000

힌트

출처

ICPC > Regionals > North America > Mid-Central Regional > 2018 Mid-Central Regional Programming Contest F번

ICPC > Regionals > North America > Southeast USA Regional > 2018 Southeast USA Regional Programming Contest > Division 2 B번

ICPC > Regionals > North America > Pacific Northwest Regional > 2018 Pacific Northwest Region Programming Contest > Division 1 G번

ICPC > Regionals > North America > Pacific Northwest Regional > 2018 Pacific Northwest Region Programming Contest > Division 2 T번

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

출처

대학교 대회

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

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