#CCBCHBA0000125. Tam giác số Pascal đến hàng n (Pascal Triangle: First n Rows)
Tam giác số Pascal đến hàng n (Pascal Triangle: First n Rows)
Pascal Triangle: First n Rows
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given , print the first rows of Pascal’s triangle, indexed . Row contains binomial coefficients . Separate numbers by one space, without trailing spaces.
Input
One line contains integer .
Output
Print exactly Pascal rows, indexed through .
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
4
Output:
1
1 1
1 2 1
1 3 3 1
Explanation:
Print rows 0 through n-1 of Pascal’s triangle.
Example 2
Input:
1
Output:
1
Explanation:
Print rows 0 through n-1 of Pascal’s triangle.