# Improving Quick Sort

`#include <iostream>#include <vector>#include <cstdlib>using std::vector;using std::swap;using std::cout;using std::cin;vector<long long int> partition3(vector<long long int> &a, long long int l, long long int r) {    long long int i = l;    long long int gt = r - 1;    long long int lt = l;    long long int v = a.at(l);    while (i < gt) {        cout << '\n';        if (a.at(i) < v) {            swap(a.at(i), a.at(lt));            i++;            lt++;        }        else if (a.at(i) > v) {            swap(a.at(i), a.at(gt));            gt--;        }        else {            i++;        }    }    return {lt, gt};}void randomized_quick_sort(vector<long long int> &a, long long int l, long long int r) {  if (l >= r) {    return;  }  long long int k = l + rand() % (r - l + 1);  swap(a[l], a[k]);  vector<long long int> v = partition3(a, l, r);  long long int m1 = v[0];  long long int m2 = v[1];  randomized_quick_sort(a, l, m1 - 1);  randomized_quick_sort(a, m2 + 1, r);}int main() {    vector<long long int> v, res;    long long int n, var;    cin >> n;    for (long long int i = 0; i < n; i++) {        cin >> var;        v.push_back(var);    }    randomized_quick_sort(v, 0, n);    for (long long int i = 0; i < n; i++) {      cout << v.at(i) << ' ';    }    cout << '\n'    return 0;}`