eolymp
bolt
Try our new interface for solving problems
Problems

Kingdom Division

Kingdom Division

The king of Geometry-Land is in deep trouble. He has three sons who use to quarrel all the time. The king tried many different policies to stop them, but in vain. So, the king became anxious. "How about dividing the kingdom?" the king thought to himself. So, he called the advisors and described his plan. They opened the map. \includegraphics{https://static.e-olymp.com/content/ed/ed373c76c9264a7cc7287bf534cc2f0a0c211ebe.jpg} The kingdom is triangular. The king denoted '\textbf{A}', '\textbf{B}', '\textbf{C}' for the three vertices. He drew a line from \textbf{B} to \textbf{E} (\textbf{E} is any point in segment \textbf{AC}) and a line from \textbf{C} to \textbf{F} (\textbf{F} is any point in segment \textbf{AB}). The intersection of \textbf{BE }and \textbf{CF} was denoted by \textbf{X}. Now they got four areas - \textbf{a} (triangle \textbf{BFX}), \textbf{b} (triangle \textbf{BCX}), \textbf{c} (triangle \textbf{CEX}) and \textbf{d} (quadrilateral \textbf{AEXF}). The king decided to give these areas - \textbf{a}, \textbf{b}, \textbf{c} to his three sons. And the area \textbf{d} would be the king's new kingdom. You are the head advisor. The king will tell you the value of \textbf{a}, \textbf{b} and \textbf{c}. You have to find the area \textbf{d}. If you can't determine the value of \textbf{d} then report it. \InputFile The input file contains several sets of inputs. The total number of sets will be less than \textbf{1000}. The description of each set is given below: Each set starts with three non-negative real numbers \textbf{a}, \textbf{b}, \textbf{c} (separated by spaces) as defined in the statement. The input will be terminated by the set where \textbf{a} = \textbf{-1}. And this set should not be processed. \OutputFile For each set in the input, you should first print the set number starting from \textbf{1}. Then in the next line print \textbf{d} (the area of the king after the division) rounded to \textbf{4} decimal points or 'Poor King!' (without the quotes) if you can't determine. Check the sample input-output for more details. Output should be formatted like the sample output.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1 2 1
2 4 2
1 3 3
-1 0 0
Output example #1
Set 1:
2.0000
Set 2:
4.0000
Set 3:
5.0000