import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ###################################################################### def floor_decomposition(x, MAX): # k = floor(x / i) (L < i <= R) となる (k, L, R) のリストを返す res = [] R = MAX while R: q = x // R L = x // (q + 1) res.append((q, L, R)) R = L return res def merge(A, B): i = 0 j = 0 ans = [] X = 10 ** 18 while i < len(A) and j < len(B): #print(X, A[i], B[j]) if A[i][0] < B[j][0]: ans.append((max(A[i][1], B[j][1]), X)) X = max(A[i][1], B[j][1]) if A[i][1] < B[j][1]: j += 1 else: i += 1 return ans N = 2 * 10 ** 5 + 10 n = ni() a = na() rui = [0] * (N + 1) pre = floor_decomposition(a[0], N) for i in range(n-1): now = floor_decomposition(a[i+1], N) for l, r in merge(pre, now): if r + 1 <= N: rui[r+1] -= 1 if l + 1 <= N: rui[l+1] += 1 pre = now for i in range(N): rui[i+1] += rui[i] ans = 10 ** 18 I = -1 for i in range(1, N): if ans > (1 + rui[i]) * (i + 1): ans = (1 + rui[i]) * (i+1) I = i print(I) print(ans)