2014年ACM-ICPC东北赛区热身赛D题 Number

来源:互联网 发布:深圳燕麦科技知乎 编辑:程序博客网 时间:2024/04/28 21:11

Description

A Sunday afternoon,star found a very interestring mathematicproblem in a book.Hewas so excited and quickly got the answers of the front simplesituations.Little by little,it becamemore and more difficult to do.Then star though he needs some help.Willyou the intelligentprogrammer help him to calculate this problem?

The topic is like this:suppose thereare 3*n+2 balls interconnect like the chart shows,nartual numbers 1 to 3*n+2 is these ball's serialnumber.Like the chart,the connected ball'sdifference of serial number absolute value is the sequence1,2,3......3n+1.

Input

The input contains many kinds ofcases,each case one line,contains a natural number n(n<1000).

Output

Each input case,outputs three lines,the nartual number separates with the blank space,between each kind of case separates with the white line.

2 6

1 8 4 5

3 7


2 95

1 11 4 5 7

3 106


2 125 9

1 14 4 11 78

3 136 10

Simple Input

2

3

4

Simple Output

0 2 6 0
1 8 45
0 3 70


0 2 95 0
1 11 48 7
0 3 106 0


0 2 125 9 0
1 14 411 7 8
0 3 136 10 0


0 0
原创粉丝点击