Print Pyramid

4.5

4 votes
Problem

Given N, the number of rows of a right-hand pyramid.
Your task is to print the pyramid.

For N<0, print  -1.

Example Input

N=5

Example Output

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

 

Example Input 2

3

 

Example Output 2

1

1 2

1 2 3

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?