import sys,random,bisect from collections import deque,defaultdict from heapq import heapify,heappop,heappush from itertools import permutations from math import gcd,log input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) N = int(input()) A = li() arg_x = 1 min_val = 2*N plus = set([i for i in range(N)]) minus = set([i for i in range(N)]) diff = [(A[i+1]-A[i],i) for i in range(N-1)] diff.sort(reverse=True) for x in range(1,2*N+1): """ 種類数は [2N/(x+1)] 以下 → A_i-A_{i-1} >= x が成り立つiは [2N/(x+1)]個以下 """ while diff and diff[-1][0] <= x: d,i = diff.pop() plus.remove(i) minus.remove(i+1) #print(x,plus,minus) if len(plus) * (x+1) < min_val: tmp = 0 for i in plus: tmp += A[i]//x for i in minus: tmp -= A[i]//x tmp += len(plus) tmp *= (x+1) if tmp < min_val: arg_x,min_val = x,tmp print(arg_x) print(min_val)