1189 杨辉三角形


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

打印杨辉三角形。

Input

输入数据含有不多于50个的正整数n(n≤10)。

Output

三角形的每个项占3个字符宽。每个三角形之间空一行,最后的三角形之后没有空行。见样本输出。

Sample

Input

10 3

Output

1
                          1     1
                       1     2     1
                    1     3     3     1
                 1     4     6     4     1
              1     5    10    10     5     1
           1     6    15    20    15     6     1
        1     7    21    35    35    21     7     1
     1     8    28    56    70    56    28     8     1  
  1     9    36    84   126   126    84    36     9     1

        1
     1     1
  1     2     1

Source: qianneng


Comments

There are no comments at the moment.