1395: 造型矩阵之蛇形矩阵

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:1

Description

对于一个N × M的矩阵,请你按规则填充上1.. N×M的数字。

例如: N=5  M=7

Input

2个整数,N,M

Output

试题要求的 N × M 蛇形矩阵,每两整数用一个空格隔开

Sample Input Copy

5 7

Sample Output Copy

1 2 6 7 15 16 25
3 5 8 14 17 24 26
4 9 13 18 23 27 32
10 12 19 22 28 31 33
11 20 21 29 30 34 35

HINT

0 < N,M<100