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

31894번 - Carl’s Vacation 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB68362950.877%

문제

Carl the ant is back! After traversing meandering paths (Problem A, 2004 World Finals) and wandering over octahedrons (Problem C, 2009 World Finals) it is time for a little vacation — time to see the sights! And where better to see the sights than at the tips of tall structures like, say, pyramids!! And where better to see tall pyramids but Egypt!!! (This is so exciting!!!!!)

After taking in the view from the tip of one pyramid, Carl would like to go to the tip of another. Since ants do not do particularly well in the hot sun, he wants to find the minimum distance to travel between the tips of these two pyramids, assuming he can only walk on the surfaces of the pyramids and the plane which the pyramids sit upon. The pyramids are, geometrically, right square pyramids, meaning the apex of the pyramid lies directly above the center of a square base.

Figure 1: Illustration of two pyramids corresponding to Sample Input 1. The black line shows the shortest path between their apexes.

입력

The first line of input contains five integers $x_1,y_1,x_2,y_2,h$ where $x_1,y_1,x_2,y_2$ ($-10^5≤x_1,y_1,x_2,y_2≤10^5$ and $(x_1,y_1) \ne (x_2,y_2)$) define an edge of the first pyramid, with the body of the pyramid lying to the left of the directed vector from $(x_1,y_1)$ to $(x_2,y_2),ドル and $h$ (1ドル≤h≤10^5$) is the height of the pyramid. The second line of input describes the second pyramid in the same format. The intersection of the bases of the two pyramids has 0ドル$ area.

출력

Output the minimum distance Carl travels between the tips of the two pyramids. Your answer should have an absolute or relative error of at most 10ドル^{-6}$.

제한

예제 입력 1

0 0 10 0 4
9 18 34 26 42

예제 출력 1

60.866649532

힌트

출처

ICPC > World Finals > ICPC World Finals 2022 T번

ICPC > World Finals > ICPC World Finals 2023 D번

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

출처

대학교 대회

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

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