eolymp
bolt
Попробуйте наш новый интерфейс для отправки задач
Задачи

Wally World

Wally World

Two star-crossed lovers want to meet. The two lovers are standing at distinct points in the plane (but then again, aren't we all?). They can travel freely except that there is a single wall which cannot be crossed. The wall is a line segment which is parallel to either the \textbf{x} or \textbf{y} axis. Each lover can move \textbf{1} unit in \textbf{1} second. How long will it take them to be together if they both choose the best path? \InputFile Input for each test case will consist of two lines each containing four integers. The first two integers will specify the \textbf{x}and \textbf{y} coordinates of the first lover; the next two integers will specify the \textbf{x} and \textbf{y} coordinates of the second lover. The next four integers will specify the start and end points of the wall. Furthermore, in all cases both lovers will not be on the (in nite) line containing the wall | that is, the wall extended in both directions. All coordinates will be positive and less than or equal to \textbf{10000} and neither lover will start on the wall. The input will be terminated by a line containing four zeroes. \OutputFile For each test case, output the minimum time in seconds for the two lovers to meet. Print the answer to exactly \textbf{3}decimal places, using the output format shown in the example.
Лимит времени 1 секунда
Лимит использования памяти 64 MiB
Входные данные #1
5 2 7 2
1 1 1 100
1 2 3 2
2 1 2 100
0 0 0 0 
Выходные данные #1
Case 1: 1.000
Case 2: 1.414
Источник 2011 East Central Regional Contest