For this Question: Sara is building a tower with N disks of sizes 1 to N. 

The rules for building the tower are simple:-
*Every day you are provided with one disk having distinct size.
*The disk with larger sizes should be placed at the bottom of the tower.
*The disk with smaller sizes should be placed at the top of the tower.
*You cannot put a new disk on the top of the tower until all the larger disks that are given to you get placed.

Your task is to print N lines denoting the disk sizes that can be put on the tower on the i<sup>th</sup> day.The first line of input contains a single integer N. The next line of input contains N space separated integers depicting the size of the discs.

Constraints:-
1 <= N <= 100000
1 <= Size <= NPrint N lines. In the ith line, print the size of disks that can be placed on the top of the tower in descending order of the disk sizes.

If on the ith day no disks can be placed, then leave that line empty.Sample Input:-
5
4 5 1 2 3

Sample Output:-

5 4


3 2 1

Explanation
On the first day, the disk of size 4 is given. But you cannot put the disk on the bottom of the tower as a disk of size 5 is still remaining.

On the second day, the disk of size 5 will be given so now the disk of sizes 5 and 4 can be placed on the tower. 

On the third and fourth days, disks cannot be placed on the tower as the disk of 3 needs to be given yet. Therefore, these lines are empty. 

On the fifth day, all the disks of sizes 3, 2, and 1 can be placed on the top of the tower.

Sample Input:-
3
3 2 1

Sample Output:-
3
2
1, I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

vector<vector<int> > SolveTower (int N, vector<int> a) {
   // Write your code here
   vector<vector<int> > ans;
   int done = N;
   priority_queue<int> pq;
   for(auto x: a){
      pq.push(x);
      vector<int> aux;
      while(!pq.empty() && pq.top() == done){
         aux.push_back(done);
         pq.pop();
         done--;
      }
      ans.push_back(aux);
   }
   sort(a.begin(), a.end());
   a.resize(unique(a.begin(), a.end()) - a.begin());
   assert(a.size() == N);
   return ans;
}

int main() {

    ios::sync_with_stdio(0);
    cin.tie(0);
    int N;
    cin >> N;
    assert(1 <= N && N <= 1e6);
    vector<int> a(N);
    for(int i_a = 0; i_a < N; i_a++)
    {
    	cin >> a[i_a];
    }

    vector<vector<int> > out_;
    out_ = SolveTower(N, a);
    for(int i = 0; i < out_.size(); i++){
       for(int j = 0; j < out_[i].size(); j++){
          cout << out_[i][j] << " ";
       }
       cout << "\n";
    }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?