#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int N;
  vector<int> a;
  cin >> N;
  int tmp;
  int sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> tmp;
    a.push_back(tmp);
    sum += tmp;
  }
  float ave = sum / (float)N;
  cout << ave << endl;
  int ans = 0;
  float min = 9999999;
  for (int i = 0; i < N; i++) {
    if (min > fabs((float)a[i] - ave)) {
      min = fabs((float)a[i] - ave);
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
