#include <bits/stdc++.h>   using namespace std;   int main() {     int n, a[1007];     cin >> n;     for (int i = 0; i < n; i++) cin >> a[i];     int ans, min = 10000007, sum = 0;     for (int i = 1; i <= 100; i++) {       sum = 0;       for (int j = 0; j < n; j++) {         if (a[j] > i + 1)           sum += a[j] - i - 1;         else if (a[j] < i - 1)           sum += i - 1 - a[j];       }       if (min > sum) min = sum, ans = i;     }     cout << ans <<     << min << endl;     return 0;   }   