#include using namespace std; int main() { int N; cin >> N; vector A(N); for( int i = 0; i < N; i++ ) { cin >> A[i]; } vector f(N); for( int x = 1; x <= N; x++ ) { int cnt = 0, pos = 0; while( (x+1)*cnt <= 2*N && pos < N ) { int ok = pos, ng = N; while( ok+1 < ng ) { int k = (ok+ng)/2; if( A[pos]/x == A[k]/x ) ok = k; else ng = k; } cnt++; pos = ok+1; } f[x-1] = (x+1)*cnt; } auto itr = min_element(f.begin(), f.end()); cout << itr-f.begin()+1 << "\n" << *itr << endl; }