Nice Set of Points

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

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 NN points. The ii-th point is at (x_i,y_i)(x\_i, y\_i).

You are allowed to add up to 10000N10000 - N points. Convert the given set of points into a nice set.

입력

NN
x_1x\_1  y_1y\_1
x_2x\_2 y_2y\_2
\vdots
x_Nx\_N y_Ny\_N

출력

Let M(0M10000N)M (0 \leq M \leq 10000 - N) be the number of added points, and (s_1,t_1),,(s_M,t_M)(s\_1, t\_1), \ldots, (s\_M, t\_M) be their coordinates. After adding these MM points to the set, you get N+MN + M points. These N+MN+M points must be pairwise distinct, and this set must be nice. The coordinates must be integers.

Output the answer in the following format.

MM
s_1s\_1 t_1t\_1
s_2s\_2 t_2t\_2
\vdots
s_Ns\_N t_Mt\_M

If there are multiple possible solutions, output any.

제한

  • 2N10002 \leq N \leq 1000
  • 1x_i,y_i10001 \leq x\_i, y\_i \leq 1000
  • The points are pairwise distinct.
  • Under these constraints, it is guaranteed that at least one solution exists.
  • All values in the input are integers.

힌트

In Sample 1, if you add (1,2)(1, 2), you can move between (1,1)(1, 1) and (2,2)(2, 2) via (1,2)(1, 2).