func_code_string: #include <bits/stdc++.h>   using namespace std;   int arr[3000000];   long long fadd[3000000];   long long carry[3000000];   long long tot[3000000];   int main() {     ios_base::sync_with_stdio(0);     int n;     cin >> n;     for (int i = 0; i < n; i++) cin >> arr[i];     int nsize = 2 * n + 1;     for (int i = 0; i < nsize; i++) fadd[i] = carry[i] = tot[i] = 0;     for (int i = 0; i < n; i++) {       int k = i + 1;       int x = arr[i];       fadd[n - k + 1] += x - 1;       carry[n - k + 1] -= 1;       carry[n - k + x] += 2;       carry[2 * n - k] -= 1;       fadd[2 * n - k + 1] += x - n;     }     long long ctot = 0;     long long ccarry = 0;     for (int i = 0; i < nsize; i++) {       ctot += fadd[i] + ccarry;       ccarry += carry[i];       tot[i] = ctot;       if (i >= n) tot[i % n] += tot[i];     }     long long ans = 1e12;     int bval = 0;     for (int i = 0; i < n; i++) {       if (tot[i] < ans) {         ans = tot[i];         bval = i;       }     }     cout << ans <<     << bval <<   n ;   }   