func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     vector<pair<long long, int>> xs(n);     for (int i = 0; i < xs.size(); ++i) {       cin >> xs[i].first;       xs[i].second = i + 1;     }     sort(xs.begin(), xs.end());     int k;     cin >> k;     vector<long long> sums1(n), sums2(n);     int qk = 2;     long long sumsl = 0;     int jl = 0;     long long cur_sum = 0;     long long min_sum = -1;     int min_pos = -1;     for (int i = 1; i < k; ++i) {       sumsl += xs[i].first - xs[0].first;     }     for (int i = 1; i < xs.size(); ++i) {       sums1[i] = sums1[i - 1] + (xs[i].first - xs[i - 1].first) * (qk - 1);       if (qk <= k) {         qk++;         cur_sum += sums1[i];       } else {         sums1[i] -= xs[i].first - xs[jl].first;         ++jl;         cur_sum = cur_sum + sums1[i] - sumsl;         sumsl = sumsl - (xs[jl].first - xs[jl - 1].first) * (k - 1) +                 (xs[i].first - xs[jl].first);       }       if (qk > k) {         if (min_sum == -1 || cur_sum < min_sum) {           min_sum = cur_sum;           min_pos = i;         }       }     }     for (int i = 0; i < k; ++i) {       cout << xs[min_pos - i].second <<    ;     }     return 0;   }   