시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 20 | 10 | 9 | 56.250% |
Consider a set of points. You can move directly between two points if their x-coordinates are the same or their y-coordinates are the same. A set of points is called nice if for any two points in the set, the length of the shortest (direct or indirect) path is equal to the manhattan distance between them.
You are given $N$ points. The $i$-th point is at $(x_i, y_i)$.
You are allowed to add up to $10000 - N$ points. Convert the given set of points into a nice set.
$N$
$x_1$ $y_1$
$x_2$ $y_2$
$\vdots$
$x_N$ $y_N$
Let $M (0 \leq M \leq 10000 - N)$ be the number of added points, and $(s_1, t_1), \ldots, (s_M, t_M)$ be their coordinates. After adding these $M$ points to the set, you get $N + M$ points. These $N+M$ points must be pairwise distinct, and this set must be nice. The coordinates must be integers.
Output the answer in the following format.
$M$
$s_1$ $t_1$
$s_2$ $t_2$
$\vdots$
$s_N$ $t_M$
If there are multiple possible solutions, output any.
2 1 1 2 2
1 1 2
4 1 1 2 2 3 4 4 3
4 1 2 3 2 3 3 4 4
7 2 4 3 2 4 6 5 1 6 5 7 3 8 7
15 3 6 8 5 2 2 7 5 2 5 6 6 3 1 5 6 6 2 6 1 7 1 7 2 2 3 6 7 2 6
In Sample 1, if you add $(1, 2)$, you can move between $(1, 1)$ and $(2, 2)$ via $(1, 2)$.