#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, x = 1, ans, zi = 0; cin >> n; vector a(n), b(n); for(auto &&v:a) cin >> v; a.push_back(2e9); ans = 2 * n; auto f = [&](int v){ if(v + 1 > ans) return ans; int cnt = 0; for(int i = 0; i < n; ){ cnt++; if((v + 1) * cnt > ans) return ans; int ng = i, ok = n, mid; while(ng + 1 < ok){ mid = (ok + ng) / 2; if(a[i] / v < a[mid] / v) ok = mid; else ng = mid; } i = ok; } return (v + 1) * cnt; }; for(int i = 2; i <= 2 * n; i++){ int v = f(i); if(v < ans){ ans = v; x = i; } } cout << x << '\n'; cout << ans << '\n'; }