#include <bits/stdc++.h>   using namespace std;   long long n, ans = 0, minm;   long long A[10 * 100000 + 6];   unordered_map<long long, long long> M;   long long pos, neg, cc = 0, k = 0;   int main() {     scanf( %lld , &n);     for (int i = 1; i <= n; ++i) {       scanf( %lld , &A[i]);       M[A[i] - i]++;       ans += abs(A[i] - i);       if (A[i] <= i)         neg++;       else         pos++;     }     minm = ans;     for (long long i = 1, j = n; i <= n - 1; ++i, --j) {       if (A[j] - j - cc <= 0)         --neg;       else         --pos;       ans -= abs(A[j] - j - cc);       ans += A[j];       ++pos;       M[A[j] + cc]++;       M[A[j] - j]--;       ++cc;       ans -= pos;       ans += neg;       pos -= M[cc];       neg += M[cc];       if (ans <= minm) {         minm = ans;         k = i;       }     }     printf( %lld %lld n , minm, k);     return 0;   }   