#include #include using namespace std; int main(){ int n; int p = 0,tmp = 0; cin >> n; vector a(n,0); for(int d = 0; d < n; d++){ cin >> a[d]; } for(int i = 1; i < 2*n-3;i++){ for(int q = 1; q <= n - 1; q++){ p = i-q; if(p >= 0 && q < n && p < q){ //cout << "p:"<

a[q]){ tmp = a[p]; a[p] = a[q]; a[q] = tmp; } } } } for(auto e : a) cout << e << " "; cout << endl; return 0; }