func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:320000000 )   using namespace std;   const double EPS = 1e-9;   const int INF = 0x7f7f7f7f;   const double PI = acos(-1.0);   template <class T>   inline T Abs(T n) {     return ((n) < 0 ? -(n) : (n));   }   template <class T>   inline T Max(T x, T y) {     return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y;   }   template <class T>   inline T Min(T x, T y) {     return (((y - x) >> (32 - 1)) & (x ^ y)) ^ x;   }   template <class T>   inline T Swap(T &a, T &b) {     a = a ^ b;     b = a ^ b;     a = a ^ b;   }   template <class T>   inline T gcd(T a, T b) {     return (b) == 0 ? (a) : gcd((b), ((a) % (b)));   }   template <class T>   inline T lcm(T a, T b) {     return ((a) / gcd((a), (b)) * (b));   }   template <class T>   inline T bigmod(T p, T e, T M) {     long long ret = 1;     for (; e > 0; e >>= 1) {       if (e & 1) ret = (ret * p) % M;       p = (p * p) % M;     }     return (T)ret;   }   template <class T>   inline T modinverse(T a, T M) {     return bigmod(a, M - 2, M);   }   struct an {     int a;     int d;     bool operator<(const an &t) const { return d < t.d; }   };   int main() {     int i, j, k, n, a[200];     int miniind, maxiind, maxi, mini;     while (scanf( %d , &n) != EOF) {       maxi = 0;       mini = 200;       for (i = 0; i < n; i++) {         scanf( %d , &a[i]);         if (a[i] > maxi) {           maxi = a[i];           maxiind = i;         }         if (a[i] < mini) {           mini = a[i];           miniind = i;         }       }       printf( %d n ,              max(n - maxiind - 1, max(maxiind, max(n - miniind - 1, miniind))));     }     return 0;   }   