import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd n = int(input()) a = list(map(int,input().split())) a.append(10**10) ans = [2*n, 1] for i in range(2, 2*n+1): j = 0 cnt = 0 while j < n: now = a[j]//i t = bisect_left(a, i*(now+1)) j = t cnt += 1 if (i+1) * cnt >= 2*n: break ans = min(ans, [cnt * (i+1), i]) print(ans[1]) print(ans[0])