import math n = int(input()) A = list(map(int, input().split())) A_sorted = sorted(A) max_A = A_sorted[-1] if n > 0 else 0 candidates = set() # Add X from 1 to sqrt(max_A) max_x_sqrt = int(math.isqrt(max_A)) if max_A > 0 else 0 for x in range(1, max_x_sqrt + 1): candidates.add(x) # Add candidates from each A_i for a in A_sorted: if a == 0: continue max_k = int(math.isqrt(a)) for k in range(1, max_k + 1): x1 = a // k if x1 <= max_A: candidates.add(x1) x2 = x1 + 1 if x2 <= max_A: candidates.add(x2) # Add X = max_A + 1 candidates.add(max_A + 1) min_f = float('inf') best_x = None for x in sorted(candidates): prev = None count = 0 for a in A_sorted: q = a // x if q != prev: count += 1 prev = q current_f = (x + 1) * count if current_f < min_f or (current_f == min_f and x < best_x): min_f = current_f best_x = x print(best_x) print(min_f)