eolymp
bolt
Try our new interface for solving problems
Məsələlər

Contraband

Contraband

It has been reported that something fell out of an aircraft approaching the airport over the bay. Thinking the object may have been some sort of contraband to be picked up by a confederate, the police want to watch for a repeat whenever any of the aircraft that could have been the one that dropped the object again approaches the airport over the bay. Three observstion stations with night vision equipment have been stationed around the bay (see figure below). \includegraphics{https://static.e-olymp.com/content/4f/4f279d78eacc344de9261967d5d9424e4b42ff94.jpg} Station \textbf{1} is \textbf{3.715} kilometers east and \textbf{1.765} kilometers north of station \textbf{0} and station \textbf{2} is \textbf{2.894} kilometers east and \textbf{2.115} kilometers south of station \textbf{0}. When a suspect aircraft crosses the bay, each observer follows it with the night vision equipment wile in contact with the other. In ane observer sees something falling from the aircraft, each records a direction to the object and a\textit{confidence level} for thet direction. The \textit{confidence level} (CL) is a value from \textbf{0} (more or less pointing at the aircraft) to \textbf{1 }(pointing at the splash where the object hit the water). In general, the three sight lines will not cross at a single point but will form a triangle (See \textit{Intersection Detal}above). The best estimate of the actual position is to be the point (\textbf{x}, \textbf{y}) which minimizes the sum of the squares of the dastances \textbf{d\[i\]}, to each line, weighted by the confidence level, \textbf{CL\[i\] + 0.2}, \textbf{Minimize SUM(i = 0 to 2) \{(CL\[i\] + 0.2) * d\[i\]^2\}} For thes problem, you will write a program which fakes as input the three observer directions and the three confidnce levels and outputs the point (\textbf{x}, \textbf{y}), which minimizes the above sum, where \textbf{x} is the dastance in kilometers east of station \textbf{0} and \textbf{y} is the distance in kilometers north (positive) or south (negative) of station \textbf{0}. \InputFile The first line of input contains a single integer \textbf{P}, (\textbf{1} ≤ \textbf{P} ≤ \textbf{1000}), which is the number of data sets that follow. Each data set should be processed identically and independently. Each data set is a single line of input consisting of the data set number \textbf{N}, followed by a space, followed by six space separated floating point values. The floating point values are, in order, \textbf{a\[0\]}, \textbf{CL\[0\]}, \textbf{a\[1\]}, \textbf{CL\[1\]}, \textbf{a\[2\]}, \textbf{CL\[2\]}. \textbf{a\[i\]} is the bearing (in degrees clockwise from north) from station \textbf{i} (\textbf{0} ≤ \textbf{a\[i\]} ≤ \textbf{360}), and \textbf{CL\[i\]} is the confidence level of observer \textbf{i }(\textbf{0} ≤ \textbf{CL\[i\]} ≤ \textbf{1}). \OutputFile For each data set there is one line of output. It contains the data set number, N, followed by a single space witch is then followed by two space separated values, \textbf{x} and \textbf{y}. \textbf{x} is the distance east of station \textbf{0} in kilometers, and \textbf{y} is the distance north (positive) or south (negative) of station \textbf{0}. The distances should be displayed to \textbf{3} decimal places.
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB
Giriş verilənləri #1
3
1 44.0 0.38 272.9 0.41 345.5 0.64
2 43.5 0.80 263.6 0.81 338.2 0.83
3 45.9 0.50 279.2 0.78 348.7 0.81
Çıxış verilənləri #1
1 1.847 1.877
2 1.440 1.511
3 2.073 2.021
Mənbə 2013 ACM Greater New York Region, Октябрь 27, Задача I