Problem: You are tasked with creating a special numbering pattern for a triangular grid of side length n.

The triangle is formed using rows such that:
- The first row has n elements.
- The second row has n - 1 elements.
- The third row has n - 2 elements.
- ...
- The last row has 1 element.

Your job is to fill this triangular grid with integers starting from 01, following a unique diagonal numbering pattern.

Numbering Rules

1. Start from the top-left element of the triangle with 01.
2. Fill the numbers diagonally downward while moving to the right.
3. Each diagonal starts from the top row and moves down toward the bottom-left of the triangle.
4. Filling must stay within the valid triangular bounds.

Hint

In each row, the difference between two consecutive entries increases by 1 with each step. The same rule applies to each column.

Input

An integer n, representing the side length of the triangle.

Output

Print n lines.
The i-th line contains n - i + 1 integers corresponding to the i-th row of the triangle.

Assumptions on Input

1 <= n <= 13

Note

- Do not print any extra messages such as:
  cout << "Enter a number"
  cout << "The computed answer is"
- Use cout only to print the computed final output.
- Do not print unnecessary spaces.
- Do not hard-code the solution.
- If any test case passes by simply printing with cout and without logic, marks will not be awarded.

Student submission:
#include <simplecpp>
main_program{
    int n;
    if(n>=1 && n<=13)
    { 
        if(n==1){cout << 01;}
        else
        if (n==2){cout << 01 << 02 << endl;
        cout << 03 << endl;}else

        if (n==9){cout <<01<<02<<04<<07<<11<<16<<22<<29<<37<<endl;
        cout<<03<<05<< 8 <<12<<17<<23<<30<<38<<endl;
        cout<<06<< n <<13<<18<<24<<31<<39<<endl;
        cout<<10<<14<<19<<25<<32<<40<<endl;
        cout<<15<<20<<26<<33<<41<<endl;
        cout<<21<<27<<34<<42<<endl;
        cout<<28<<35<<43<<endl;
        cout<<36<<44<<endl;
        cout << 45<<endl;
        }else
        if(n==07)

{cout <<01<<02<<04<< n <<11<<16<<22<<endl;
        cout<<03<<05<< 8 <<12<<17<<23<<endl;
        cout<<06<< 9 <<13<<18<<24<<endl;
        cout<<10<<14<<19<<25<<endl;
        cout<<15<<20<<26<<endl;
        cout<<21<<27<<endl;
        cout<<28<<endl;
        
        }
else if(n==6){cout <<01<<02<<04<<07<<11<<16<<endl;
        cout<<03<<05<<8<<12<<17<<endl;
        cout<<06<<9<<13<<18<<endl;
        cout<<10<<14<<19<<endl;
        cout<<15<<20<<endl;
        cout<<21<<endl;
        
        }
        else if(n==5){cout <<01<<02<<04<<07<<11<<endl;
        cout<<03<<05<< 8 <<12<<endl;
        cout<<06<< 9 <<13<<endl;
        cout<<10<<14<<endl;
        cout<<15<<endl;
        
        }
        else if(n==4)
{cout <<01<<02<<04<<07<<endl;
        cout<<03<<05<< 8 <<endl;
        cout<<06<< 9 <<endl;
        cout<<10<<endl;
        
        }
        else if (n=3)
{cout <<01<<02<<04<<endl;
        cout<<03<<05<<endl;
        cout<<06<<endl;
        
        }
        else if (n=10)
   {cout <<01<<02<<04<<07<<11<<16<<22<<29<<37<<46<<endl;
        cout<<03<<05<<8<<12<<17<<23<<30<<38<<47<<endl;
        cout<<06<<9<<13<<18<<24<<31<<39<<48<<endl;
        cout<<10<<14<<19<<25<<32<<40<<49<<endl;
        cout<<15<<20<<26<<33<<41<<50<<endl;
        cout<<21<<27<<34<<42<<51<<endl;
        cout<<28<<35<<43<<52<<endl;
        cout<<36<<44<<53<<endl;
        cout << 45<<54<<endl;
        cout <<55<<endl;
        }
        else if(n==11)
        {cout <<01<<02<<04<<07<<11<<16<<22<<29<<37<<46<<56<<endl;
        cout<<03<<05<<8<<12<<17<<23<<30<<38<<47<<57<<endl;
        cout<<06<<9<<13<<18<<24<<31<<39<<48<<58<<endl;
        cout<<10<<14<<19<<25<<32<<40<<49<<59<<endl;
        cout<<15<<20<<26<<33<<41<<50<<60<<endl;
        cout<<21<<27<<34<<42<<51<<61<<endl;
        cout<<28<<35<<43<<52<<62<<endl;
        cout<<36<<44<<53<<63<<endl;
        cout << 45<<54<<64<<endl;
        cout <<55<<65<<endl;
        cout <<66<<endl;
        }
        else if(n==12){cout <<01<<02<<04<<07<<11<<16<<22<<29<<37<<46<<56<<67<<endl;
        cout<<03<<05<<8<<12<<17<<23<<30<<38<<47<<57<<68<<endl;
        cout<<06<<9<<13<<18<<24<<31<<39<<48<<58<<69<<endl;
        cout<<10<<14<<19<<25<<32<<40<<49<<59<<70<<endl;
        cout<<15<<20<<26<<33<<41<<50<<60<<71<<endl;
        cout<<21<<27<<34<<42<<51<<61<<72<<endl;
        cout<<28<<35<<43<<52<<62<<73<<endl;
        cout<<36<<44<<53<<63<<74<<endl;
        cout << 45<<54<<64<<75<<endl;
        cout <<55<<65<<76<<endl;
        cout <<66<<77<<endl;
        cout<<78<<endl;
        }
        else if(n=13){cout <<01<<02<<04<<07<<11<<16<<22<<29<<37<<46<<56<<67<<79<<endl;
        cout<<03<<05<<8<<12<<17<<23<<30<<38<<47<<57<<68<<80<<endl;
        cout<<06<<9<<13<<18<<24<<31<<39<<48<<58<<69<<81<<endl;
        cout<<10<<14<<19<<25<<32<<40<<49<<59<<70<<82<<endl;
        cout<<15<<20<<26<<33<<41<<50<<60<<71<<83<<endl;
        cout<<21<<27<<34<<42<<51<<61<<72<<84<<endl;
        cout<<28<<35<<43<<52<<62<<73<<85<<endl;
        cout<<36<<44<<53<<63<<74<<86<<endl;
        cout << 45<<54<<64<<75<<87<<endl;
        cout <<55<<65<<76<<88<<endl;
        cout <<66<<77<<89<<endl;
        cout<<78<<90<<endl;
        cout<<91<<endl;
        }
    }
}

Grading criterion: Space and New line
Rating A: Correctly adds a space between each number in the pattern and a new line chracter for printing the pattern on n lines

Rating B: Some issue. 

Rating C: Major issue. 

Rating D: 0
Assigned grade: C