For this Question: Given an N-size array of unique integers, your task is to print the array in a waveform, i. e a1 >= a2 <= a3 >= a4 <= a5.. . print the lexicographically smallest array possible.The first line of input contains a single integer N, next line contains N space-separated integers depicting the values of the array.

<b>Constraints:-</b>
1 &le; N &le; 10<sup>5</sup>
1 &le; Arr[i] &le; 10<sup>9</sup>Print the array in wave form as mentioned.Sample Input :-
5
2 1 3 5 4

Sample Output:-
2 1 4 3 5

Sample Input:-
3
1 2 3

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

signed main()
{
   
    int n,m;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
    cin>>a[i];
}
  sort(a,a+n);
  for(int i=0;i<n-1;i+=2){
    cout<<a[i+1]<<" ";
    cout<<a[i]<<" ";
  }
  if(n&1){
    cout<<a[n-1]<<" ";
  }
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?