問題一覧 > 通常問題

No.3664 Manhattan Circumcenter

レベル : / AI推定難易度 : 1600 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-9}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 18
作問者 : sepa38 / テスター : dyktr_06 t5ugu
お気に入りにしたユーザー ProblemId : 12051 / 自分の提出
問題文最終更新日: 2026-08-30 13:57:27
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
MMA Contest 022 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。