eolymp
bolt
Try our new interface for solving problems

Titanic

It is a historical fact that during the legendary voyage of "Titanic" the wireless telegraph machine had delivered \textbf{6} warnings about the danger of icebergs. Each of the telegraph messages described the point where an iceberg had been noticed. The first five warnings were transferred to the captain of the ship. The sixth one came late at night and a telegraph operator did not notice that the coordinates mentioned were very close to the current ship's position. Write a program that will warn the operator about the danger of icebergs! \InputFile The input messages are of the following format: \includegraphics{https://static.e-olymp.com/content/ac/ac7c07f1724297937377769295455d2e07427745.jpg} Here <\textbf{n}> is a positive integer, <\textbf{HH}>:<\textbf{MM}>:<\textbf{SS}> is the time of the message reception, <\textbf{X1}>^<\textbf{X2}>'<\textbf{X3}>" <\textbf{NL/SL}> and <\textbf{Y1}>^<\textbf{Y2}>'<\textbf{Y3}>" <\textbf{EL/WL}> means "\textbf{X1} degrees \textbf{X2} minutes \textbf{X3} seconds of North (South) latitude and \textbf{Y1} degrees \textbf{Y2} minutes \textbf{Y3} seconds of East (West) longitude." \OutputFile Your program should print to the output message in the following format: \textbf{The distance to the iceberg: <s> miles.} Where <\textbf{s}> should be the distance between the ship and the iceberg, (that is the length of the shortest path on the sphere between the ship and the iceberg). This distance should be printed up to (and correct to) \textbf{two decimal digits}. If this distance is less than (but not equal to!) \textbf{100} miles the program should print one more line with the text: \textbf{DANGER!}
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 16 MiB
Giriş verilənləri #1
Message #513.
Received at 22:30:11. 
Current ship�s coordinates are 
41^46'00" NL 
and 50^14'00" WL.
An iceberg was noticed at
41^14'11" NL 
and 51^09'00" WL.
===
Çıxış verilənləri #1
The distance to the iceberg: 52.04 miles.
DANGER!
Müəllif Evgeny Shtykov
Mənbə 1999 III Ural Collegiate Programming Contest, Ekaterinburg, March 19 - 20, Problem C