For this Question: You will be given an array A of n integers, you need to rearrange the array to the lexicographically smallest array such that the elements of array appear in the following manner:
A[0] >= A[1] <= A[2] >= A[3] <= A[4] ....The first line of input contains an integer n, the number of elements in array.
The next line contains n integers, the elements of the array.

Constraints
1 <= n <= 100000
1 <= A[i] <= 1000000000Output the required array with space separated integers.Sample Input
4
3 2 1 4

Sample Output
2 1 4 3

Explanation
Other possible array satisfying the condition is [4 1 3 2] but that is not lexicographically smallest., I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

#define pu push_back
#define fi first
#define se second
#define mp make_pair
#define int long long
#define pii pair<int,int>
#define mm (s+e)/2
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(int i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define sz 200000
signed main()
{
 

        int n;
        cin>>n;
        vector<int> A;
        for(int i=0;i<n;i++)
        {
           int a;
           cin>>a;
           A.pu(a);
        }
        sort(A.begin(),A.end());
        for(int i=0;i<n;i++)
        {

            i++;
            if(i==n) cout<<A[i-1]<<" ";
            else{
                cout<<A[i]<<" "<<A[i-1]<<" ";
            }
        }
    
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?