1 3 6 10 15
2 5 9 14
4 8 13
7 12
2 5 9 14
4 8 13
7 12
11
public class Algorithm {
public static void main(String[] args) {
int k = 1;
int n;
Scanner scanner = new Scanner(System.in);
n = scanner.nextInt();
int [][] a = new int[n+1][n+1];
for(int i = 1;i <= n;i++){
for(int j = 1;j <= i;j++){
a[i-j+1][j] = k;
k++;
}
}
for(int i = 1;i <= n;i++){
for(int j = 1;j <= n-i+1;j++){
System.out.print(a[i][j]+" ");
//System.out.println(Arrays.toString(a[i]));
}
System.out.println();
}
//System.out.println(Arrays.deepToString(a));
}
}