No.3664 Manhattan Circumcenter
Problem Statement
You are given $3$ distinct points $P, Q, R$ on a two-dimensional plane.
Find the coordinates of all points that are at equal Manhattan distance from points $P, Q, R$.
If there are infinitely many such coordinates, output -1.
Constraints
- $0 \leq P_x, P_y, Q_x, Q_y, R_x, R_y \leq 100$
- All inputs are integers.
Input
$P_x\ P_y$ $Q_x\ Q_y$ $R_x\ R_y$
Output
If there are infinitely many solutions, output -1. If the number of solutions is finite, output the number of solutions on the $1$st line, and if there are $1$ or more solutions, then output their coordinates.
If there are multiple solutions, output them in ascending order of $x$ coordinate, and those with the same $x$ coordinate in ascending order of $y$ coordinate.
If solutions exist, your output is judged as correct if the absolute error or relative error from the true solution is at most $10^{-9}$ in each dimension.
Sample
Sample 1
Input
0 0 2 0 2 2
Output
1 1 1
Sample 2
Input
0 0 1 0 2 0
Output
0
Sample 3
Input
0 0 1 1 2 0
Output
-1
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
sepa38