Mock DWITE '09 P3 - Trailing Bears!

View as PDF

Submit solution

Points: 7
Time limit: 2.5s
Memory limit: 256M

Problem type
2009 Mock DWITE by A.J.: Problem 3

Being the avid bear hunter he is, Brian is hot on the trail of yet another bear. While chasing after the bear (well, mainly the bear's excretions...), Brian remembered that almost all the bears he had chased follow a set pattern:

  • Their excretions are found on the border of their respective 'territories' (which conveniently tend to be perfectly circular in shape)
  • Their caves are usually located at the centers of their respective territories.

Assuming these facts, help Brian locate the bear's cave, given the locations of three droppings known to belong to the bear.

Input Specification

The input will contain five cases, each of which spans three lines. Each case describes a different bear. Within an individual test case, each line will contain the x-coordinate and the y-coordinate (integers of absolute value not greater than 1\,000) of one of the bear's droppings, in that order, separated by a space.

Output Specification

For each line given in input, in the order given, print one line containing two space-separated real numbers, the coordinates of the bear (first x-coordinate then y-coordinate), rounded to exactly two digits after the decimal place. The answer is guaranteed to exist and be unique.

Sample Input (only two cases shown)

0 0
0 1
1 0
1 2
2 4
4 10

Sample Output

0.50 0.50
-25.50 16.50

Note on rounding

There are two different conventions regarding how numbers should be rounded when the first non-significant digit is a five and all following digits are zeroes. In this particular problem, for example, what would you do if one of the coordinates in the output were 2.345? Would you round it up to 2.35 or down to 2.34? Luckily, this situation never arises in the official test data, so it is safe to use your language's built-in rounding functionality, if it exists.


Comments

There are no comments at the moment.