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

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 9 5

1 11 4 5 7

3 10 6


2 12 5 9

1 14 4 11 7 8

3 13 6 10

Simple Input

2

3

4

Simple Output

0 2 6 0
1 8 4 5
0 3 7 0


0 2 9 5 0
1 11 4 8 7
0 3 10 6 0


0 2 12 5 9 0
1 14 4 11 7 8
0 3 13 6 10 0


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值