#P102. [Sleeping Cup #3] Missing circle
[Sleeping Cup #3] Missing circle
Person in Charge
Attention
This problem requires file I/O (circle.in / circle.out).
Problem Description
There is a plane. A Cartesian coordinate system is established with the bottom-left corner as the origin, and the top-right corner is denoted as . Thus, each point can be uniquely represented by its coordinates.
Sleeping Cat drew a circle with a radius no less than inside the plane and then uniformly randomly selected points on the plane.
Sleeping Cat did not tell you the center or radius of the circle, and you need to deduce it. However, Sleeping Cat won't leave you completely in the dark—he provided the relative positions of the points with respect to the circle (whether they are inside the circle, with points exactly on the circle treated as inside).
Input Format
lines, each containing two -decimal-place numbers and an integer (guaranteed to be or ), representing the coordinates of a point and its relative position ( means inside the circle, means outside).
Output Format
The first line should contain two real numbers , representing the center of the circle.
The second line should contain a real number , representing the radius of the circle.
Scoring Details
You will score points if:
- Your program fails to run or produces incorrect output format.
- The output does not satisfy .
Otherwise:
- If the Euclidean distance between your provided center and the actual center is no more than units, you score points.
- If the absolute difference between your provided radius and the actual radius is no more than units, you score points.
- These two parts are scored independently.
Attachments
Download the files here.
We provided gen.cpp as the Generator but did not provide sample files.
After compiling gen.cpp into an executable gen, use the following command to generate the sample:
gen circle.in circle.ans(Windows)../gen circle.in circle.ans(Linux).