1016:
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.
Note: the number of first circle should always be 1.
大意:
一个环由n个圈组成的如图表中所示。把自然数1~n个数单独的放进每个圆圈里去,并且在两个相邻圆圈的数字之和应该是一个素数。
注意:第一个圆的数字应该总是1。
输入Input:
n (0 < n < 20).
输出:
The output format is shown as sample below. Each row represents a series of circle numbers in the ring beginning from 1 clockwisely and anticlockwisely. The order of numbers must satisfy the above requirements. Print solutions in lexicographical order.
You are to write a program that completes above process.
Print a blank line after each case.
输出在如样例中所示。每一行展示的数字从1开始顺时针方向直至逆时针方向。输出的这些数字必须满