Online Judge

1260 : Omniscia Spares None

         Time Limit: 1 Sec     Memory Limit: 256 Mb     Submitted: 6     Solved: 4     SpecialJudge


\(\textit{Our fortune is clouded with uncertainty. }\)

\(\textit{The omniscia sees through you... }\)

\(\textit{All things in this world have their laws... }\)

\(\textit{Yet stratagems, constellations... are human creations! }\)

The Disciples of Sanctus Glue-Catfish are cheating and oppressing the civilians. They have plundered and damaged many valuable works, treading on people’s effort.

However, the Matrix of Prescience has stopped operating, the symbols have dimmed, and the Disciples of Sanctus Glue-Catfish have not been destroyed. Fu Xuan wants to restore the Matrix of Prescience, but she has no forces available. She needs your help to restart the Matrix of Prescience’s base terminals and eliminate the abominations of Sanctus Glue-Catfish along the way.

Each base terminal can be seen as a chessboard. The \(n\)-th base terminal contains \(n\) layouts. To active the base terminal, you should move the layouts on the ground and connect some pairs of them to make the pattern satisfy:

  • The coordinates of each layout are integers, and no two layouts are in the same position;
  • The graph of layouts and connections is a simple graph;
  • Each connecting line is a segment. And no two connecting segments intersect internally. That is, every two connecting segments can only intersect at endpoints(layouts);
  • No more than 4 layouts have connections less than 6.

Now, given \(n\), please find a solution for the \(n\)-th base terminal. (If there are multiple solutions, print any one of them. If no solution, report it.)

A simple graph is an undirected graph which is:

  • Not a multigraph, that is, there is no more than one edge between each pair of vertices;
  • Not a loop-graph, that is, there are no loops, that is, edges which start and end at the same vertex.




  • \(1\leq n\leq 100\)


If no solution, print No in one line. Else print Yes in one line and then print your arrangement in following format:

\(x_1\quad y_1\)

\(x_2\quad y_2\)

\(\quad \vdots\)

\(x_n\quad y_n\)


\(u_1\quad v_1\)

\(u_2\quad v_2\)

\(\quad \vdots\)

\(u_m\quad v_m\)

where \(x_i, y_i\,(|x_i|, |y_i| \le 10^9)\) denotes the coordinates of the \(i\)-th layout, \(m\) denotes the number of pairs of the layouts you connect. \(u_i, v_i\,(1 \le u_i, v_i \le n)\) denotes there is a connection between the \(u_i\)-th layout and the the \(v_i\)-th layout.

All numbers you output should be integers.



-1 0
0 1
1 0
1 2
2 3

-998244353 -998244353
0 998244353
6 6
1 1
1 2
4 3


For more example, the following arrangements are all legal:

But this one is illegal because there are connections intersect internally: