#include #include using namespace std; int main() { int n; cin >> n; if(n<1 || n>20) { cout << "-1" << endl; return -1; } if(n==1) cout << "1" << endl; else if(n==2) cout << "1" << endl << "1 1" << endl; else { vector> mat(n, vector(n)); for(int i = 0; i < n; i++) { for(int j = 0; j <= i;j++) { if(j==0||j==i) mat[i][j] = 1; else mat[i][j] = mat[i-1][j-1] + mat[i-1][j]; } } for(int i = 0; i < n; i++) { for(int j = 0; j < (i+1);j++) { cout << mat[i][j] << " "; } cout << endl; } } }