func_code_string: #include <bits/stdc++.h>      using namespace std;   #define int long long      int scalar(int Ax, int Ay, int Bx, int By) {       return Ax * Bx + Ay * By;   }      bool isok(int x1, int y1, int x2, int y2, int x3, int y3) {       int Ax = x1 - x2;       int Ay = y1 - y2;       int Bx = x3 - x2;       int By = y3 - y2;       if (scalar(Ax, Ay, Bx, By) <= 0) {           return false;       } else {           return true;       }   }      vector<pair<int, int>> points;   vector<int> per;      void add(int id) {       if (per.size() <= 1) {           per.push_back(id);           return;       }       vector<int> new_p;       for (int i = per.size() - 2; i >= 0; --i) {           if (isok(points[per[i]].first, points[per[i]].second, points[per[i + 1]].first, points[per[i + 1]].second,                    points[id].first, points[id].second)) {               for (int j = 0; j <= i + 1; ++j) {                   new_p.push_back(per[j]);               }               new_p.push_back(id);               for (int k = i + 2; k < per.size(); ++k) {                   new_p.push_back(per[k]);               }               break;           }       }       if (new_p.size() == 0) {           reverse(per.begin(), per.end());           for (int i = per.size() - 2; i >= 0; --i) {               if (isok(points[per[i]].first, points[per[i]].second, points[per[i + 1]].first, points[per[i + 1]].second,                        points[id].first, points[id].second)) {                   for (int j = 0; j <= i + 1; ++j) {                       new_p.push_back(per[j]);                   }                   new_p.push_back(id);                   for (int k = i + 2; k < per.size(); ++k) {                       new_p.push_back(per[k]);                   }                   break;               }           }       }       per = new_p;   }      signed main() {       cin.tie();       cout.tie();       ios_base::sync_with_stdio(false);       int n;       cin >> n;       for (int i = 0; i < n; ++i) {           int x, y;           cin >> x >> y;           points.push_back({x, y});           add(i);       }       for (int j = 0; j < per.size(); ++j) {           cout << per[j] + 1 <<    ;       }   }