# PROBLEM LINK:

[Practice ] (Contest Page | CodeChef)

**Author:** [Siddharth Jha]

(sidjha69 | CodeChef User Profile for Siddharth Jha | CodeChef)

# DIFFICULTY:

SIMPLE

# PREREQUISITES:

Loops

# PROBLEM:

Everyone here would have played Super Mario game. Mario has been assigned to save the princess who is stuck at Nth floor and Mario is M meters apart from princess, Mario has to build a staircase using the boxes lying around. Each box is of 1 meter length and Mario can only jump 1 meter high.

# QUICK EXPLANATION:

Outward loop had to be incremented from

0 to N and inner loop had to be increased from 0 to i. To reach the princess mario had to be x meters apart and princess had to exactly at xth floor, which means N=M

# SOLUTIONS:

## Setter's Solution

```
#include <iostream>
using namespace std;
void print (int row,int column) {
for (int i=0; i<=row; i++) {
for (int j=0; j<i; j++)
cout <<"*";
cout << "\n";
}
}
int main () {
int N,M;
cin >> N >> M;
print(N,M);
}
```