#include<iostream>
#include<vector>
using namespace std;
int partition(vector<int>& arr, int l, int r) {
int pivot = arr[r];
int i = l;
for (int j = l; j < r; j++) {
if (arr[j] <= pivot) {
swap(arr[i++], arr[j]);
}
}
swap(arr[i], arr[r]);
return i;
}
int randomPartition(vector<int>& arr, int l, int r) {
int pivotPos = (random() % (r - l + 1) + l);
swap(arr[pivotPos], arr[r]);
return partition(arr, l, r);
}
void quichRank(vector<int>& arr, int l, int r) {
if (l <= r) {
int pivotPos = randomPartition(arr, l, r);
quichRank(arr, l, pivotPos - 1);
quichRank(arr, pivotPos + 1, r);
}
}
int main() {
vector<int> arr;
for (int i = 0; i < 1; i++) {
arr.push_back(random()%100);
}
quichRank(arr, 0, arr.size() - 1);
for (auto num : arr) {
cout << num << " ";
}
return 0;
}