import sys from collections import deque, Counter import time input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 import random import bisect n = ii() a = li() def check(x, k): now = 0 cnt = 0 while now < n: cnt += 1 if cnt > k: return cnt now = bisect.bisect_left(a, x * (a[now] // x + 1)) return cnt ans = 2 * n x = 1 for i in range(2, 2 * n): k = ans // (i + 1) p = check(i, k) if ans > p * (i + 1): ans = p * (i + 1) x = i print(x) print(ans)