#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, k;
  vector<double> a;
  cin >> n;
  double avg = 0;
  int i = 0;
  for (i = 0; i < n; i++) {
    cin >> k;
    a.push_back(k);
    avg += k;
  }
  avg /= n;
  cout << avg << endl;
  int d = 114514;
  for (i = 0; i < n; i++) {
    if (d > abs(avg - a[i])) {
      d = abs(avg - a[i]);
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i] == avg - d || a[i] == avg + d) {
      cout << i << endl;
      break;
    }
  }
}
