RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
ICPC00038

F. Messenger

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
Unrated 레이팅 미적용
난이도
4s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Misha needs to send packages to his friend Nadia. Both of them often travel across Russia, which is very large. So they decide to hire a messenger. Since the cost of the messenger service depends on the time it takes to deliver the package, they need your help to optimize a little bit. Assume Misha and Nadia move on a t\(wo-di\)mensional plane, each visiting a sequence of places and moving along straight line segments from place to place. Your task is to find the shortest possible delivery time given their two paths. Misha hands the package to the messenger at some point along his path. The messenger moves without delay along a straight line from the pi\(ck-up\) to intercept Nadia, who is traveling along her path. Misha, Nadia and the messenger move with a constant speed of 1 distance unit per time unit. The delivery time is the time between Misha handing over the package and Nadia receiving it.

제약
입력 형식

The input consists of a single test case. The test case contains two path descriptions, the first for Misha and the second for Nadia. Each path description starts with a line containing an integer \(n\), the number of places visited (\(2 \le n \le 50\,000\)). This is followed by \(n\) lines, each with two integers \(xi\) and \(yi\) specifying the coordinates of a place (\(0 \le x_{i}\), \(y_{i} \le 30\,000\)). Coordinates of the places are listed in the order in which they are to be visited, and successive places do not have the same coordinates. Misha and Nadia start their journeys at the same time, visiting the places along their paths without stopping. The length of each path is at most \(10^{6}\). The package must be picked up at the latest when Misha reaches his final place and it must be delivered at the latest when Nadia reaches her final place.

출력 형식

Display the minimal time needed for delivery. Give the answer with an absolute error of at most \(10^{−}^{3}\) or a relative error of at most \(10^{−}^{5}\). If the package cannot be delivered, display impossible instead.

예제 1
입력
2
0 0
0 10
2
4 10
4 0
출력
4.00000
예제 2
입력
2
0 0
1 0
3
2 0
3 0
3 10
출력
5.00000
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC World Finals 2014

평가 및 의견

F. Messenger

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

F. Messenger

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8