There were $n$ types of swords in the theater basement which had been used during the plays. Moreover there were exactly $x$ swords of each type. $y$ people have broken into the theater basement and each of them has taken exactly $z$ swords of some single type. Note that different people might have taken different types of swords. Note that the values $x, y$ and $z$ are unknown for you.

The next morning the director of the theater discovers the loss. He counts all swords — exactly $a_i$ swords of the $i$-th type are left untouched.

The director has no clue about the initial number of swords of each type in the basement, the number of people who have broken into the basement and how many swords each of them have taken.

For example, if $n=3$, $a = [3, 12, 6]$ then one of the possible situations is $x=12$, $y=5$ and $z=3$. Then the first three people took swords of the first type and the other two people took swords of the third type. Note that you don't know values $x, y$ and $z$ beforehand but know values of $n$ and $a$.

Thus he seeks for your help. Determine the minimum number of people $y$, which could have broken into the theater basement, and the number of swords $z$ each of them has taken.


-----Input-----

The first line of the input contains one integer $n$ $(2 \le n \le 2 \cdot 10^{5})$ — the number of types of swords.

The second line of the input contains the sequence $a_1, a_2, \dots, a_n$ $(0 \le a_i \le 10^{9})$, where $a_i$ equals to the number of swords of the $i$-th type, which have remained in the basement after the theft. It is guaranteed that there exists at least one such pair of indices $(j, k)$ that $a_j \neq a_k$.


-----Output-----

Print two integers $y$ and $z$ — the minimum number of people which could have broken into the basement and the number of swords each of them has taken.


-----Examples-----
Input
3
3 12 6

Output
5 3

Input
2
2 9

Output
1 7

Input
7
2 1000000000 4 6 8 4 2

Output
2999999987 2

Input
6
13 52 0 13 26 52

Output
12 13



-----Note-----

In the first example the minimum value of $y$ equals to $5$, i.e. the minimum number of people who could have broken into the basement, is $5$. Each of them has taken $3$ swords: three of them have taken $3$ swords of the first type, and two others have taken $3$ swords of the third type.

In the second example the minimum value of $y$ is $1$, i.e. the minimum number of people who could have broken into the basement, equals to $1$. He has taken $7$ swords of the first type.

Source: codeforces | Difficulty: EASY
Tags: Mathematics


Solutions:
n = int(input(''))
a = list(map(int, input('').split(' ')))
t = sum(a)
m = max(a)
yz = n * m - t
b = []
import math
for i in range(n):
	if m - a[i] != 0:
		b.append(m - a[i])
l = len(b)
g = b[0]
for i in range(l):
	g = math.gcd(b[i], g)
	if g == 1:
		break
print(str(yz // g) + ' ' + str(g))


import math
n = int(input())
a = [int(ele) for ele in input().split()]
maxi = max(a)
diff = []
for ele in a:
	diff.append(maxi - ele)
gcdn = 0
for i in range(len(diff)):
	gcdn = math.gcd(gcdn, diff[i])
count = 0
for ele in diff:
	count += int(ele / gcdn)
print(count, gcdn)


n = int(input())
li = list(map(int, input().split()))
b = max(li)
c = []
n1 = 0
for i in li:
	if i != b:
		c.append(b - i)
		n1 += 1
import math
if n1 == 0:
	print(0, 0)
else:
	a1 = c[0]
	for i in c:
		a1 = math.gcd(i, a1)
print(sum(c) // a1, a1)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def bs(a, l, h, x):
	while l < h:
		mid = (l + h) // 2
		if a[mid] == x:
			return mid
		if a[mid] < x:
			l = mid + 1
		else:
			h = mid
	return l

def sieve(a):
	for i in range(3, 10 ** 6 + 1, 2):
		a[i] = 1
	for i in range(3, 10 ** 6 + 1, 2):
		for j in range(i * i, 10 ** 6 + 1, i):
			a[j] = 0
	a[2] = 1
	return a

def bfs(g, st):
	visited = [0] * len(g)
	visited[st] = 1
	queue = []
	queue.append(st)
	new = []
	while len(queue) != 0:
		s = queue.pop()
		new.append(s)
		for i in g[s]:
			if visited[i] == 0:
				visited[i] = 1
				queue.append(i)
	return new

def intersection(a, b):
	I = [max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3])]
	return I

def area(a):
	aria = max(0, a[2] - a[0]) * max(0, a[3] - a[1])
	return aria

def solve():
	n = int(inp())
	a = lis()
	z = 0
	m = max(a)
	for i in range(0, n):
		z = gcd(z, m - a[i])
	cnt = 0
	for i in range(0, n):
		cnt += (m - a[i]) // z
	print(cnt, z)
testcase(1)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
d = max(a)
s = 0
k = 0
for i in range(n):
	s += d - a[i]
	k = gcd(k, d - a[i])
print(s // k, k)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
l = list(map(int, input().rstrip().split(' ')))
l.sort()
c = 1
for i in range(n - 2, -1, -1):
	if l[i] == l[-1]:
		c += 1
	else:
		break
if n - c <= 1:
	print(1, l[-1] - l[0])
else:
	num1 = l[-1] - l[0]
	num2 = l[-1] - l[1]
	gcd = find_gcd(num1, num2)
	t = num1 + num2
	for i in range(2, n - c):
		t += l[-1] - l[i]
		gcd = find_gcd(gcd, l[-1] - l[i])
	print(t // gcd, gcd)


import math
n = int(input())
a = list(map(int, input().split()))
m = max(a)
diffs = set((m - x for x in a))
diffs.remove(0)
diffs = list(diffs)
gcd = diffs[0]
for x in diffs:
	gcd = math.gcd(gcd, x)
z = gcd
y = 0
for x in a:
	y += (m - x) // z
print(y, z)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
arr = list(map(int, input().split()))
narr = []
count = 0
m = max(arr)
for i in range(n):
	narr.append(m - arr[i])
	count += m - arr[i]
n1 = narr[0]
n2 = narr[1]
hcf = find_gcd(n1, n2)
for i in range(2, n):
	hcf = find_gcd(hcf, narr[i])
print(count // hcf, hcf)


from functools import reduce

def gcd(a, b):
	if not b:
		return a
	return gcd(b, a % b)
n = int(input())
arr = [int(x) for x in input().split(' ')]
mx = max(arr)
arr = [mx - x for x in arr if mx - x]
GCD = reduce(gcd, arr)
print(sum(arr) // GCD, GCD)


import math
n = int(input())
a = list(map(int, input().split(' ')))
maxa = max(a)
b = list(map(lambda a_i: maxa - a_i, a))
gcd = b[0]
for b_i in b:
	gcd = math.gcd(b_i, gcd)
ans = 0
for b_i in b:
	ans += b_i // gcd
print(ans, gcd)


def hcf(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	rem = a % b
	while rem:
		(a, b) = (b, rem)
		rem = a % b
	return b
n = int(input())
a = list(map(int, input().split()))
x = max(a)
ans = 0
stolen = []
for left in a:
	stolen.append(x - left)
	ans += stolen[-1]
z = hcf(stolen[0], stolen[1])
for s in stolen:
	z = hcf(z, s)
print(ans // z, z)


import math
n = int(input())
arr = list(map(int, input().split()))
sum = sum(arr)
m = max(arr)
i = 0
while i < n:
	arr[i] = m - arr[i]
	i += 1
arr1 = list(set(arr))
b = 0
for a in arr1:
	if a != 0:
		b = math.gcd(a, b)
count = 0
for a in arr:
	count += a // b
print(str(count) + ' ' + str(b))


def compute_hcf(x, y):
	if x == 0 or y == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def swords(n, arr):
	x = max(arr)
	yz = x * n - sum(arr)
	ars = [x - i for i in arr]
	z = ars[0]
	for i in range(1, len(arr)):
		z = compute_hcf(z, ars[i])
	print(int(yz / z), z)
first = int(input())
second = [int(i) for i in input().split()]
swords(first, second)


from sys import stdin
from math import gcd
(n, swords) = (int(input()), list(map(int, stdin.readline().split())))
swords.sort(reverse=True)
(y, z) = (0, 0)
for i in range(1, n):
	y += swords[0] - swords[i]
	z = gcd(z, swords[0] - swords[i])
print(y // z, z)


from math import gcd
n = int(input())
d1 = [int(i) for i in input().split()]
mn = min(d1)
mx = max(d1)
d2 = [mx - i for i in d1]
g = d2[0]
for i in range(1, n):
	g = gcd(g, d2[i])
sm = sum(d2)
am = sm // g
print(am, g)


from functools import reduce

def find_gcd(list):
	x = reduce(gcd, list)
	return x

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
s = list(map(int, input().split()))
m = max(s)
p = []
for i in range(n):
	if m - s[i] > 0:
		p.append(m - s[i])
q = p[0]
q = find_gcd(p)
print(sum(p) // q, q)


import sys, math

def main():
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	mx = max(a)
	(s, z) = (0, 0)
	for i in range(n):
		a[i] = mx - a[i]
		s += a[i]
		z = math.gcd(a[i], z)
	y = s // z
	print(y, z)
main()


from sys import stdin
import math
n = int(stdin.readline().strip())
arr = list(map(int, stdin.readline().split()))
aux = []
mx = max(arr)
for i in arr:
	aux.append(mx - i)
g = aux[0]
for i in range(1, len(aux)):
	g = math.gcd(g, aux[i])
p = 0
for i in aux:
	p += i // g
print(p, g)


n = int(input())
count = list(map(int, input().strip().split()))
mx = 0

def gcd(a, b):
	x = min(a, b)
	y = max(a, b)
	if y % x == 0:
		return x
	else:
		return gcd(x, y % x)
for sword in count:
	mx = max(mx, sword)
r = -1
for sword in count:
	if sword - mx == 0:
		continue
	elif r == -1:
		r = mx - sword
	else:
		r = gcd(r, mx - sword)
theives = 0
for sword in count:
	theives += (mx - sword) / r
print(int(theives), r)


from sys import stdin

def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)
n = int(stdin.readline())
l = list(map(int, stdin.readline().split()))
maxi = max(l)
l2 = [maxi - x for x in l]
total = sum(l2)
g = 0
for i in l2:
	g = gcd(g, i)
print(int(total / g), g)


import math
from functools import reduce
l = int(input())
arr = list(map(lambda x: int(x), input().split(' ')))
cel = max(arr)
nwd = reduce(lambda x, y: math.gcd(x, y), map(lambda x: cel - x, arr))
people = sum(((cel - elem) // nwd for elem in arr))
print('{} {}'.format(people, nwd))


import math
n = int(input())
arr = list(map(int, input().strip().split()))
x = max(arr)
a = []
xx = x - arr[0]
for i in arr:
	ai = x - i
	a.append(ai)
	xx = math.gcd(xx, ai)
print(sum(a) // xx, xx)


import sys

def mcd(a, b):
	if a < b:
		(a, b) = (b, a)
	c = b
	while b > 0:
		r = a % b
		a = b
		c = b
		b = r
	return c

def mcm(a, b):
	return a * b // mcd(a, b)
N = int(input())
A = list(map(int, input().split()))
z = A[0]
x = A[0]
M = max(A)
B = []
z = 0
for n in range(0, N):
	if A[n] != M:
		b = M - A[n]
		B.append(b)
		if z == 0:
			z = b
		z = mcd(z, b)
y = 0
if N == 2:
	print(1, max(A) - min(A))
else:
	for a in A:
		y = y + (M - a) // z
	print(y, z)


from sys import stdin
input = stdin.readline

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
lis = list(map(int, input().split()))
m = max(lis)
for i in range(n):
	lis[i] = m - lis[i]
for i in range(n):
	if lis[i] > 0:
		break
g = lis[i]
for j in range(i + 1, n):
	if lis[j] > 0:
		g = gcd(g, lis[j])
c = 0
for i in lis:
	c += i // g
print(c, g)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
l = list(map(int, input().split(' ')))
l.sort()
c = []
for i in l:
	c.append(l[-1] - i)
c.sort()
gcd = 1
for i in c:
	if i != 0:
		gcd = i
		break
sum1 = 0
for i in c:
	sum1 = sum1 + i
for i in range(2, len(c)):
	if c[i] != 0:
		gcd = find_gcd(gcd, c[i])
print(int(sum1 / gcd), end=' ')
print(gcd)


import sys

def hcf(a, b):
	while a:
		temp = a
		a = b % a
		b = temp
	return b
n = int(sys.stdin.readline())
a = [int(i) for i in sys.stdin.readline().split()]
val = max(a)
m = val - a[0]
tmp_sum = 0
for x in range(n):
	m = hcf(val - a[x], m)
	tmp_sum += val - a[x]
print(tmp_sum // m, m)


import math
n = int(input())
arr = list(map(int, input().split()))
arr2 = list(set(arr))
arr3 = 0
arr2.sort()
z = arr2[0]
if z == 0:
	z = arr2[1]
zz = arr2[-1]
arr2.remove(zz)
g = zz - z
for k in arr2:
	g = math.gcd(zz - k, g)
for kk in arr:
	arr3 += (zz - kk) // g
print(arr3, g)


def gcd(a, n):
	from math import gcd
	if n == 1:
		return a[0]
	else:
		d = gcd(a[1], a[0])
		for i in a:
			d = gcd(d, i)
		return d

def main():
	n = int(input())
	a = list(map(int, input().split()))
	mxa = max(a)
	a = [mxa - i for i in a]
	z = gcd(a, n)
	a = [i // z for i in a]
	print(sum(a), z)
main()


import math
n = int(input())
a = list(map(int, input().split(' ')))
max1 = max(a)
b = list(map(lambda a2: max1 - a2, a))
gcd = b[0]
for i in b:
	gcd = math.gcd(i, gcd)
res = 0
for i in b:
	res += i // gcd
print(res, gcd)


from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
n = int(input())
ar = list(map(int, input().split()))
l = max(ar)
x = [l - i for i in ar]
g = x[0]
for i in range(1, len(x)):
	g = gcd(g, x[i])
print(sum(x) // g, g)


n = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
mx = max(a)
z = mx - a[0]
for i in range(1, n):
	z = gcd(z, mx - a[i])
	if z == 1:
		break
y = 0
for i in range(n):
	y += (mx - a[i]) // z
print(y, z)


from math import sqrt, ceil

def min_nPeople(nTypes, nSwordsForEachType):
	nSwordsForEachType.sort()
	highestValue = nSwordsForEachType[-1]
	(difference, iToConsider) = (0, nTypes)
	for i in range(nTypes - 2, -1, -1):
		difference = highestValue - nSwordsForEachType[i]
		if difference:
			iToConsider = i
			break
	if not iToConsider:
		print(1, difference)
		return
	finalValue = nSwordsForEachType[iToConsider - 1]
	for factor in factorsOf(difference):
		for value in nSwordsForEachType[:iToConsider]:
			if (highestValue - value) % factor:
				break
			elif value == finalValue:
				factor = round(factor)
				print((highestValue * nTypes - sum(nSwordsForEachType)) // factor, factor)
				return

def factorsOf(n):
	if n == 1:
		yield 1
		return
	(factorsStorage, squareRoot_n) = ([], sqrt(n))
	limit = ceil(squareRoot_n)
	for value in range(1, limit):
		if not n % value:
			yield (n / value)
			factorsStorage.append(value)
	if squareRoot_n == limit:
		yield limit
	factorsStorage.reverse()
	for factor in factorsStorage:
		yield factor
min_nPeople(int(input()), list(map(int, input().split())))


from sys import exit

def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
m = max(a)
p = []
for i in a:
	if m != i:
		p.append(m - i)
if len(p) == 1:
	print(1, p[0])
	exit(0)
k = gcd(p[0], p[1])
for i in range(2, len(p)):
	k = gcd(k, p[i])
ans = sum([p[i] // k for i in range(len(p))])
print(ans, k)


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
n = ii()
d = li()
m = max(d)
t = []
for i in range(n):
	t.append(m - d[i])
ms = m * n
g = t[0]
for i in range(1, n):
	g = math.gcd(g, t[i])
res = 0
for i in range(n):
	res += t[i] // g
print(res, g)


import math

def solve():
	n = int(input())
	l = list(map(int, input().split()))
	m = max(l)
	for i in range(n):
		l[i] = m - l[i]
	g = l[0]
	for i in range(1, n):
		g = math.gcd(g, l[i])
	t = 0
	for hh in l:
		t += hh // g
	print(t, g)
for _ in range(1):
	solve()


n = int(input())
a = list(map(int, input().split()))
t = max(a)
b = []
for i in a:
	b.append(t - i)
import math
g = 0
for i in b:
	g = math.gcd(g, i)
print(sum(b) // g, g)


def hcf(a, b):
	if b % a == 0:
		return a
	return hcf(b % a, a)
import sys
n = int(input())
l = list(map(int, sys.stdin.readline().split()))
l.sort()
last_d = float('inf')
h = float('inf')
for i in range(1, n):
	if l[i] - l[i - 1] > 0:
		if last_d == float('inf'):
			last_d = l[i] - l[i - 1]
		elif h == float('inf'):
			h = hcf(min(l[i] - l[i - 1], last_d), max(l[i] - l[i - 1], last_d))
		else:
			h = hcf(min(l[i] - l[i - 1], h), max(l[i] - l[i - 1], h))
if h == float('inf') and last_d == float('inf'):
	print(0, 0)
elif h == float('inf') and last_d != float('inf'):
	count = 0
	for i in range(n - 1):
		count += (l[-1] - l[i]) // last_d
	print(count, last_d)
else:
	count = 0
	for i in range(n - 1):
		count += (l[-1] - l[i]) // h
	print(count, h)


def gcd(a, b):
	while a != b and a != 0 and (b != 0):
		if a > b:
			a = a % b
		else:
			b = b % a
	return max(a, b)

def gcd_ls(ls):
	ls = list(ls)
	while len(ls) > 1:
		new_ls = []
		for i in range(0, len(ls), 2):
			if i + 1 < len(ls):
				gcd_res = gcd(ls[i], ls[i + 1])
				new_ls.append(gcd_res)
			else:
				new_ls.append(ls[i])
		ls = new_ls
	return ls[0]
n = int(input())
ls = list(map(int, input().split()))
mx = max(ls)
deltas = [0] * n
for i in range(n):
	deltas[i] = mx - ls[i]
z = gcd_ls(deltas)
y = sum(deltas) // z
print(y, z)


def gcd(a, b):
	while b:
		a %= b
		(a, b) = (b, a)
	return a
n = int(input())
l = list(map(int, input().split()))
a = max(l)
g = a - l[0]
for i in range(1, n):
	g = gcd(g, a - l[i])
s = sum(l)
ans = a * n - s
ans = ans // g
print(ans, g)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def ceil(a, b):
	return (a + b - 1) // b
S1 = 'abcdefghijklmnopqrstuvwxyz'
S2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
n = iinp()
arr = lmp()
mx = max(arr)
arr = [mx - i for i in arr]
g = 0
for i in arr:
	g = gcd(g, i)
ans = sum([i // g for i in arr])
print(ans, g)


from math import gcd
n = int(input())
arr = list(map(int, input().split()))
untouch = max(arr)
summ = 0
gcdd = 0
for i in range(n):
	summ += untouch - arr[i]
	gcdd = gcd(gcdd, untouch - arr[i])
print(summ // gcdd, gcdd)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
a = array()
tot = max(a)
ans = 0
missing = 0
for i in a:
	ans = gcd(ans, tot - i)
	missing += tot - i
print(missing // ans, ans)


import math
I = input
n = int(I())
a = list(map(int, I().split(' ')))
l = []
ma = max(a)
for i in range(n):
	if a[i] == ma:
		continue
	else:
		l.append(ma - a[i])
llen = len(l)
if llen < 2:
	if llen == 1:
		print(1, l[0])
	else:
		print(0, 0)
else:
	g = math.gcd(l[0], l[1])
	for i in range(2, llen):
		g = math.gcd(g, l[i])
	print(sum(l) // g, g)


import math
n = int(input())
A = list(map(int, input().split()))
g = None
for i in range(1, len(A)):
	d = A[i] - A[i - 1]
	if g is None:
		g = d
	else:
		g = math.gcd(g, d)
max_ = max(A)
y = 0
for n in A:
	if n < max_:
		y += (max_ - n) // g
print(y, g)


import math
type_number = int(input())
swords_number = [int(x) for x in input().split(' ')]
max_swords = max(swords_number)
people_number = 0
swords_taken = 0
for type in range(type_number):
	if swords_number[type] == max_swords:
		continue
	people_number += max_swords - swords_number[type]
	swords_taken = math.gcd(swords_taken, max_swords - swords_number[type])
print(people_number // swords_taken, swords_taken)


def main():
	from math import gcd
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	s = sum(a)
	z = 0
	for i in a:
		z = gcd(z, m - i)
	y = n * m - s
	y //= z
	print(y, z)
	return
main()


def dels(x):
	y = []
	for i in range(1, int(x ** 0.5) + 2):
		if x % i == 0:
			y.append(i)
			y.append(x // i)
	return list(set(y))
n = int(input())
a = [int(i) for i in input().split()]
x = 0
for i in range(n):
	if a[i] > x:
		x = a[i]
x0 = 0
for i in range(n):
	if x > a[i] > x0:
		x0 = a[i]
d = dels(x - x0)
for i in range(n):
	j = 0
	while j < len(d):
		if (x - a[i]) % d[j] > 0:
			d.pop(j)
		else:
			j += 1
z = max(d)
y = 0
for i in range(n):
	y += (x - a[i]) // z
print(y, z)


import math
n = int(input())
a = list(map(int, input().split()))
maxx = max(a)
summ = 0
g = maxx - a[0]
for i in a:
	l = maxx - i
	summ += l
	g = math.gcd(g, l)
print(summ // g, g)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
max_n = max(a)
min_n = min(a)
s = 0
temp_gcd = max_n - min_n
for i in a:
	s += i
	temp_gcd = gcd(temp_gcd, max_n - i)
print((max_n * n - s) // temp_gcd, temp_gcd)


def gcd(a, b):
	while b > 0:
		(a, b) = (b, a % b)
	return a
_ = input()
s = [int(x) for x in input().split()]
m = max(s)
roubadas = [m - x for x in s if x < m]
result = roubadas[0]
for i in roubadas[1:]:
	result = gcd(result, i)
print('%d %d' % (sum(roubadas) / result, result))


import math
n = int(input())
dat = list(map(int, input().split()))
dat_loss = []
m = max(dat)
nn = 0
for i in range(n):
	if dat[i] != m:
		dat_loss.append(m - dat[i])
		nn += 1
res = 0
for i in range(nn):
	res = math.gcd(res, dat_loss[i])
res2 = 0
for i in range(nn):
	res2 += dat_loss[i] // res
print('{0} {1}'.format(res2, res))


from math import gcd
n = int(input())
a = list(map(int, input().split()))
m = max(a)
hcf = 0
sum = 0
for i in range(n):
	a[i] = m - a[i]
	hcf = gcd(hcf, a[i])
for i in range(n):
	sum += a[i] // hcf
print(sum, hcf)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
x = []
a = [int(n) for n in input().split()]
m = max(a)
c = 0
for i in range(n):
	x.append(abs(a[i] - m))
r = gcd(max(x[0], x[1]), min(x[0], x[1]))
for i in range(2, n):
	r = gcd(max(r, x[i]), min(r, x[i]))
for i in x:
	c += i // r
print(c, r)


def gcd(a, b):
	while b > 0:
		(a, b) = (b, a % b)
	return a
n = int(input())
a = list(map(int, input().split()))
a.sort()
a.reverse()
z = a[0] - a[1]
for i in range(2, n):
	z = gcd(z, a[i - 1] - a[i])
x = z * (a[0] // z + (1 if a[0] % z > 0 else 0))
y = sum(((x - i) // z for i in a))
print(y, z)


import math
n = int(input())
line = input().split()
a = [0] * n
for i in range(n):
	a[i] = int(line[i])
a.sort(reverse=True)
z = 0
max_sword = a[0]
for sword in a:
	diff = max_sword - sword
	if z == 0:
		z = diff
	else:
		z = math.gcd(z, diff)
y = 0
for sword in a:
	diff = max_sword - sword
	y += diff // z
print(y, z)


def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x
qntdtipos = int(input())
lista = [int(x) for x in input().split()]
lista.sort()
conta = lista[qntdtipos - 1] - lista[0]
for k in range(1, qntdtipos):
	if lista[k] != lista[qntdtipos - 1]:
		conta = gcd(conta, lista[qntdtipos - 1] - lista[k])
numladroes = 0
for k in range(qntdtipos):
	if lista[k] != lista[qntdtipos - 1]:
		numladroes += int((lista[qntdtipos - 1] - lista[k]) / conta)
print('{} {}'.format(numladroes, conta), end='')


import math
import sys
t = 1
for _ in range(t):
	n = int(sys.stdin.readline())
	l = list(map(int, input().split()))
	m = max(l)
	for i in range(n):
		l[i] = m - l[i]
	gcd = 0
	k = 0
	for i in range(n):
		if l[i] != 0:
			gcd = l[i]
			k = i
			break
	for i in range(k + 1, n):
		gcd = math.gcd(gcd, l[i])
	ans = 0
	for i in range(n):
		ans += l[i] // gcd
	print(ans, gcd)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
maxval = max(a)
theft = [maxval - v for v in a]
z = 0
for v in theft:
	z = gcd(z, v)
a = [tmp // z for tmp in a]
maxval = max(a)
a = [tmp - maxval for tmp in a]
y = -1 * sum(a)
print(y, z)


import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
x = max(A)
from math import gcd
z = 0
SUM = 0
for a in A:
	z = gcd(z, x - a)
	SUM += x - a
y = SUM // z
print(y, z)


import math
n = int(input())
a = list(map(int, input().split(' ')))
m = max(a)
g = 0
if n == 2:
	a.sort()
	print(1, m - a[0], sep=' ')
else:
	for i in range(n):
		if a[i] != m:
			g = math.gcd(g, m - a[i])
	y = 0
	for i in range(n):
		y = y + (m - a[i]) // g
	print(y, g, sep=' ')


from math import gcd

def main():
	n = int(input())
	aa = [int(a) for a in input().split()]
	x = max(aa)
	z = x - aa[0]
	if z == 0:
		z = x - aa[1]
	for a in aa:
		if a != x:
			z = gcd(z, x - a)
	y = 0
	for a in aa:
		y = y + (x - a) // z
	print(y, z)
main()


from math import gcd
n = int(input())
a = list(map(int, input().split()))
H = max(a)
z = H - a[0]
steel = 0
for i in range(n):
	z = gcd(z, H - a[i])
	steel += H - a[i]
y = steel // z
print(y, z)


import math
from functools import reduce

def find_gcd(list):
	x = reduce(math.gcd, list)
	return x

def ain():
	return map(int, input().split())
n = int(input())
l = list(ain())
maxv = max(l)
s = []
for x in l:
	if x != maxv:
		s += [maxv - x]
z = find_gcd(s)
y = 0
for x in s:
	y += x // z
print(str(y) + ' ' + str(z))


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def solve():
	n = int(input())
	arr = list_input()
	maxx = max(arr)
	num = 0
	g = maxx - arr[0]
	for i in arr:
		num += maxx - i
		g = math.gcd(g, maxx - i)
	print(num // g, g)
t = 1
for _ in range(t):
	solve()


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
y = list(map(int, input().split()))
k = max(y)
l = []
for i in range(len(y)):
	l.append(k - y[i])
num1 = l[0]
num2 = l[1]
gcd = find_gcd(num1, num2)
for i in range(2, len(l)):
	gcd = find_gcd(gcd, l[i])
print(int(sum(l) // gcd), gcd)


n = int(input())
l = [int(x) for x in input().split()]
m = max(l)
ll = []
c = 0
for x in l:
	if x != m:
		ll.append(m - x)
ll.sort()
nn = len(ll)
a = ll[0]
for x in range(1, nn):
	b = ll[x]
	while b > 0:
		(a, b) = (b, a % b)
for x in ll:
	c += x // a
print(c, a)


import sys
import os
from math import *
input = sys.stdin.buffer.readline
n = int(input())
arr = list(map(int, input().split()))
c = max(arr)
for i in range(n):
	arr[i] = c - arr[i]
gc = arr[0]
for i in range(n):
	gc = gcd(gc, arr[i])
print(sum(arr) // gc, gc)


import math
n = int(input())
a = list(map(int, input().split()))
a.sort()
if a[0] == a[n - 1]:
	print('0 0')
else:
	ma = a[n - 1]
	z = su = a[n - 1] - a[0]
	for i in range(1, n - 1):
		if a[i] != a[n - 1]:
			temp = a[n - 1] - a[i]
			z = math.gcd(z, temp)
			su += a[n - 1] - a[i]
y = su // z
print(y, end=' ')
print(z)


import math
n = int(input())
lis = sorted(map(int, input().split()), reverse=True)
gg = 0
aa = 1
ans = 0
for i in range(n):
	gg = math.gcd(lis[0] - lis[i], gg)
for i in range(n):
	ans += (lis[0] - lis[i]) // gg
print(ans, gg)


import math
from functools import reduce

def find_gcd(list):
	x = reduce(math.gcd, list)
	return x
n = int(input())
a = list(map(int, input().split()))
m = max(a)
b = a.copy()
tl = 0
q = 0
nl = []
for o in range(n):
	if b[o] == m:
		b[o] = 0
		q += 1
	else:
		b[o] = m - b[o]
z = find_gcd(b)
num_st = n - q
for i in a:
	tl += m - i
if num_st == 1:
	print(1, tl)
else:
	print(tl // z, z)


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def solve(n, ar):
	maxi = max(ar)
	cnt = []
	for i in range(n):
		if ar[i] == maxi:
			continue
		cnt.append(maxi - ar[i])
	g = cnt[0]
	for i in range(1, len(cnt)):
		g = gcd(g, cnt[i])
	summ = sum(cnt)
	b = summ // g
	print(b, g)
n = int(input())
ar = list(map(int, input().split()))
solve(n, ar)


def gcd(a, b):
	while a > 0 and b > 0:
		if a < b:
			(a, b) = (b, a)
		a %= b
	return a + b

def main():
	n = int(input())
	a = [int(p) for p in input().split()]
	biggest = max(a)
	for i in range(n):
		a[i] = biggest - a[i]
	z = 0
	for i in range(n):
		if a[i] != 0:
			z = a[i]
			break
	j = i
	while j < n:
		z = gcd(z, a[j])
		j += 1
	y = 0
	for i in range(n):
		if a[i] != 0:
			y += a[i] // z
	print(y, z)
main()


from math import gcd
N = int(input())
List = [int(x) for x in input().split()]
Max = max(List)
Taken = []
for i in List:
	if i != Max:
		Taken.append(Max - i)
G = Taken[0]
for i in range(1, len(Taken)):
	G = gcd(G, Taken[i])
print(int(sum(Taken) / G), G)


n = int(input())
l = list(map(int, input().split()))

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
lmax = max(l)
m = l.copy()
for i in range(len(m)):
	m[i] = lmax - m[i]
num1 = m[0]
num2 = m[1]
gcd = find_gcd(num1, num2)
for i in range(2, len(m)):
	gcd = find_gcd(gcd, m[i])
count = 0
for i in range(n):
	count += m[i] // gcd
print(count, gcd)


import math
n = int(input())
a = [int(o) for o in input().split()]
b = []
ma = max(a)
for i in range(n):
	if a[i] != ma:
		b.append(ma - a[i])
if b:
	g = b[0]
	for i in range(1, len(b)):
		g = math.gcd(g, b[i])
	y = 0
	for i in b:
		y += i // g
	print(y, g)
else:
	print(0, 0)


import math
n = int(input())
a = list(map(int, input().split()))
k = max(a)
flag = False
sumi = 0
for i in range(n):
	sumi += k - a[i]
	if a[i] == k:
		continue
	elif flag == False:
		res = k - a[i]
		flag = True
	else:
		res = math.gcd(res, k - a[i])
print(sumi // res, '', res)


from math import gcd
n = int(input())
l = list(map(int, input().split()))
l.sort()
s = l[-1]
g = 0
s1 = 0
for i in range(n - 1):
	g = gcd(g, l[-1] - l[i])
	s1 = s1 + l[-1] - l[i]
print(int(s1 // g), g)


def gcd(a, b):
	if a < b:
		return gcd(b, a)
	if b == 0:
		return a
	return gcd(b, a % b)

def main():
	input()
	arr = list(map(int, input().split(' ')))
	M = max(arr)
	GCD = 0
	for x in arr:
		if M - x > 0:
			GCD = gcd(GCD, M - x)
	res = sum([(M - x) // GCD for x in arr])
	print(res, GCD)
main()


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
a = list(map(int, input().split()))
sn = 0
b = list()
mx = max(a)
for i in range(n):
	if a[i] != mx:
		sn += mx - a[i]
		b.append(mx - a[i])
gcd = 0
if len(b) > 1:
	num1 = b[0]
	num2 = b[1]
	gcd = find_gcd(num1, num2)
	for i in range(2, len(b)):
		gcd = find_gcd(gcd, b[i])
	ans1 = sn // gcd
elif len(b) == 1:
	ans1 = 1
	gcd = b[0]
print(ans1, gcd)


from math import gcd
from functools import reduce
types = int(input())
swords = [int(x) for x in input().split(' ')]
x = max(swords)
y = 0
swordsdiff = [0 for x in range(types)]
for i in range(types):
	swordsdiff[i] = x - swords[i]
z = reduce(gcd, swordsdiff)
for i in swords:
	y += (x - i) // z
print(str(y) + ' ' + str(z))


int(input())
L = list(map(int, input().split()))
from math import *
curGcd = None
ma = max(L)
D = []
for l in L:
	if l != ma:
		if not curGcd:
			curGcd = ma - l
		else:
			curGcd = gcd(curGcd, ma - l)
		D += [ma - l]
ans = 0
for d in D:
	ans += d // curGcd
print(ans, end=' ')
print(curGcd)


n = int(input())
a = list(map(int, input().split()))
M = max(a)

def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	while b != 0:
		(a, b) = (b, a % b)
	return a
r = M - a[0]
for i in range(1, n):
	r = gcd(r, M - a[i])
ans = 0
for i in a:
	ans += (M - i) // r
print(ans, r)


import math
input()
a = (*map(int, input().split()),)
m = max(a)
d = 0
for x in a:
	d = math.gcd(d, m - x)
print((len(a) * m - sum(a)) // d, d)


N = int(input())
a_list = list(map(int, input().split()))
from math import gcd
max_a = max(a_list)
b_list = []
margin = []
for a in a_list:
	if a != max_a:
		b_list.append(a)
		margin.append(max_a - a)
a = margin[0]
if len(margin) > 1:
	for i in range(1, len(margin)):
		a = gcd(a, margin[i])
sum_margin = sum(margin)
print(sum_margin // a, a)


import math
n = int(input())
a = list(map(int, input().split()))
l = max(a)
c = []
for i in range(len(a)):
	c.append(l - a[i])
p = 0
for i in range(len(c)):
	p = math.gcd(p, c[i])
o = sum(c)
print(o // p, p)


import math
n = int(input())
a = list(map(int, input().rstrip().split()))
if n == 2:
	print(1, max(a) - min(a))
	exit()
gcd = a[0]
for i in range(1, n):
	gcd = math.gcd(gcd, a[i])
sum1 = 0
maxi = max(a)
b = []
for i in range(n):
	b.append(maxi - a[i])
gcd = b[0]
for i in range(1, n):
	gcd = math.gcd(gcd, b[i])
sum1 = 0
for i in range(n):
	sum1 += b[i] // gcd
print(sum1, gcd)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
s = list(map(int, input().split()))
k = max(s)
sum1 = 0
b = [0] * n
for i in range(n):
	b[i] = k - s[i]
	sum1 += b[i]
gcd = find_gcd(b[0], b[1])
for i in range(2, n):
	if b[i] != 0:
		gcd = find_gcd(gcd, b[i])
print(sum1 // gcd, gcd)


def resto(a, b):
	if a == 0:
		return b
	else:
		return resto(b % a, a)
n = int(input())
entrada = [int(i) for i in input().split(' ')]
x = 0
x = max(entrada)
z = 0
for i in entrada:
	z = resto(z, x - i)
y = 0
for i in entrada:
	y += (x - i) // z
print(y, z, sep=' ')


def nod(a, b):
	while a * b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return a + b
n = int(input())
l = [int(j) for j in input().split()]
y = 0
mx = max(l)
z = mx - l[0]
for i in range(1, n):
	z = nod(z, mx - l[i])
for i in range(n):
	y += (mx - l[i]) // z
print(y, z)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def solve(a, n, mx):
	gc = gcd(a[0], a[1])
	for i in range(2, n):
		gc = gcd(gc, a[i])
	sm = sum(a)
	return (sm // gc, gc)
n = int(input())
new = list(map(int, input().split()))
mx = max(new)
a = []
for i in new:
	a.append(mx - i)
(s, u) = solve(a, n, mx)
print(s, u)


import sys
from math import gcd
zz = 1
sys.setrecursionlimit(10 ** 5)
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def ii():
	return input().rstrip()

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def gtc(tc, ans):
	print('Case #' + str(tc) + ':', ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = 1
uu = t
while t > 0:
	t -= 1
	n = fi()
	a = li()
	p = max(a)
	d = []
	for i in a:
		if i - p:
			d.append(p - i)
	s = sum(d)
	g = d[0]
	for i in range(1, len(d)):
		g = gcd(g, d[i])
	print(s // g, g)


import sys, math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def main():

	def input():
		return sys.stdin.readline()[:-1]
	n = int(input())
	a = list(map(int, input().split()))
	t = max(a)
	y = t - a[0]
	for e in a:
		y = gcd(t - e, y)
	z = 0
	for e in a:
		z += (t - e) // y
	print(z, y)
main()


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify, nlargest
from copy import deepcopy
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def inpl_1():
	return list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))

def inps():
	return sys.stdin.readline()

def inpsl(x):
	tmp = sys.stdin.readline()
	return list(tmp[:x])

def err(x):
	print(x)
	exit()
n = inp()
a = inpl()
mx = max(a)
b = []
g = 0
for (i, x) in enumerate(a):
	rem = mx - x
	g = math.gcd(g, rem)
	b.append(rem)
y = 0
for x in b:
	y += x // g
print(y, g)


def arr():
	return list(map(int, input().split()))

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
n = int(input())
a = arr()
b = []
x = max(a)
for i in a:
	if x - i != 0:
		b.append(x - i)
ans = b[0]
for i in range(len(b)):
	ans = gcd(ans, b[i])
y = sum(b) // ans
print(y, ans)


def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
n = ii()
a = li()
a.sort()
mx = a[n - 1]
z = a[n - 1] - a[0]
s = a[n - 1] - a[0]
for i in range(1, n - 1):
	if a[i] != a[n - 1]:
		z = math.gcd(z, a[n - 1] - a[i])
		s += a[n - 1] - a[i]
print(s // z, z)


def gcdd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def solve(arr):
	m = max(arr)
	diffs = [m - k for k in arr]
	q = 0
	for n in diffs:
		q = gcdd(n, q)
	y = min(q, sum(diffs) // q)
	z = max(q, sum(diffs) // q)
	for diff in diffs:
		if diff % z != 0:
			(y, z) = (z, y)
			break
	return (y, z)
input()
a = input().split()
a = [int(x) for x in a]
(y, z) = solve(a)
print(y)
print(z)


def gcd(a, b):
	if a == 0:
		return b
	else:
		return gcd(b % a, a)
n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
maxi = max(a)
b = gcd(maxi - a[0], maxi - a[1])
for j in range(2, n):
	b = gcd(b, maxi - a[j])
ans = 0
for i in range(n):
	ans += (maxi - a[i]) // b
print(ans, b)


from collections import deque
import sys
import math

def inp():
	return sys.stdin.readline().strip()
n = int(inp())
a = list(map(int, inp().split()))
x = max(a)
b = [x - i for i in a]
b.sort()
b = b[1:]
gcd = b[0]
for i in range(1, len(b)):
	gcd = math.gcd(b[i], gcd)
y = sum((i // gcd for i in b))
print(y, gcd)


n = int(input())
a = list(map(int, input().split()))

def lcm(a, b):
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return a + b
x = max(a)
z = 0
s_diff = 0
for i in range(n):
	diff = x - a[i]
	z = lcm(z, diff)
	s_diff += diff
print(s_diff // z, z)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
import functools, math
n = rint()
a = rints()
m = max(a)
d = [m - ai for ai in a if ai < m]
g = functools.reduce(math.gcd, d)
print(sum(d) // g, g)


from math import gcd
n = int(input())
arr = [int(p) for p in input().split()]
m = max(arr)
total = m * n
missing = total - sum(arr)
diff = []
for i in range(len(arr)):
	if m - arr[i] != 0:
		diff.append(m - arr[i])
if len(diff) == 1:
	print(1, diff[0])
else:
	curr = max(diff)
	for i in range(len(diff)):
		curr = gcd(curr, diff[i])
	print(missing // curr, curr)


import math
n = int(input())
s = input()
list = s.split()
for i in range(n):
	list[i] = int(list[i])
maxi = max(list)
list_ = []
sum = 0
for i in range(n):
	sum += maxi - list[i]
	if maxi - list[i] != 0:
		list_.append(maxi - list[i])
hcf = list_[0]
for i in range(0, len(list_)):
	hcf = math.gcd(hcf, list_[i])
print(int(sum / hcf), hcf)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
(a, b) = ([], [])
n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
x = max(a)
for i in range(n):
	if a[i] != x:
		b.append(x - a[i])
if len(b) >= 2:
	z = gcd(b[0], b[1])
	for i in range(2, len(b)):
		z = gcd(z, b[i])
	y = int(sum(b) / z)
else:
	(y, z) = (1, b[0])
print(y, z)


import sys
from math import gcd
from functools import reduce
sin = sys.stdin
n = int(sin.readline())
a = sin.readline().split()
a = [int(x) for x in a]
a.sort(reverse=True)
m = a[0]
diffs = []
totalDiff = 0
for i in a:
	d = m - i
	if d > 0:
		diffs.append(d)
		totalDiff += d
g = reduce(gcd, diffs)
print(int(totalDiff / g), g)


from math import gcd

def nod(a, b):
	while b > 0:
		(a, b) = (b, a % b)
	return a

def nods(s):
	a = 0
	for i in s:
		a = nod(a, i)
	return a
n = int(input())
a = [int(s) for s in input().split()]
b = []
q = max(a)
for i in range(n):
	b.append(q - a[i])
z = nods(b)
print(sum(b) // z, z)


import math
n = int(input())
a = list(map(int, input().split()))
x = max(a)
total = 0
k = 0
for i in a:
	total += x - i
	k = math.gcd(k, total)
print(total // k, k)


import math
R = lambda : map(int, input().split())
n = int(input())
L = list(R())
m = max(L)
s = sum(L)
k = n * m - s
for i in range(n):
	L[i] = m - L[i]
L = sorted(L)
i = 0
while i < n:
	if L[i] != 0:
		break
	i += 1
g = L[i]
i += 1
while i < n:
	g = math.gcd(g, L[i])
	i += 1
print(k // g, g)


from math import gcd
n = int(input())
a = tuple(map(int, input().split()))
(b, c, x) = (0, 0, max(a))
for i in a:
	b += x - i
	c = gcd(c, x - i)
print(b // c, c)


from math import gcd
from functools import reduce

def gcd_list(a):
	ans = reduce(gcd, a)
	return ans
n = int(input())
a = list(map(int, input().split()))
mn = min(a)
a = [el - mn for el in a]
z = gcd_list(a)
mx = max(a)
y = 0
for el in a:
	y += (mx - el) // z
print(y, z)


from math import *
n = int(input())
inp = input()
inp_arr = inp.split(' ')
inp_arr = [int(i) for i in inp_arr]
maximum = max(inp_arr)
inp_arr = [maximum - inp_arr[i] for i in range(n)]

def gcd_arr(arr, n):
	curr_gcd = arr[0]
	for i in arr:
		curr_gcd = gcd(curr_gcd, i)
	return curr_gcd
gcd_val = gcd_arr(inp_arr, n)
inp_arr = [inp_arr[i] // gcd_val for i in range(n)]
y = sum(inp_arr)
z = gcd_val
print(str(y), str(z))


def findhcf(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def haha(a):
	if len(a) == 1:
		return a[0]
	if len(a) == 2:
		return findhcf(a[0], a[1])
	b = [findhcf(a[-2], a[-1])]
	i = 0
	while i < len(a) - 1:
		b.append(findhcf(a[i], a[i + 1]))
		i += 2
	set(b)
	return haha(b)
k = input()
ha = input()
num0 = ha.split(' ')
num = []
diff = []
hcf = 1
for i in num0:
	num.append(int(i))
max0 = max(num)
num1 = num
set(num1)
for i in num1:
	t = max0 - i
	if t > 0:
		diff.append(t)
hcf = haha(diff)
tsum = 0
for i in num:
	tsum += int((max0 - i) / hcf)
print(str(tsum) + ' ' + str(hcf))


import functools
import math
n = int(input())
tab = list(map(int, input().split()))
y = max(tab)
new_tab = tab.copy()
for i in range(n):
	new_tab[i] = y - new_tab[i]
z = functools.reduce(math.gcd, new_tab)
y = 0
for i in range(n):
	y += new_tab[i] // z
print(y, z)


types = int(input())
left = list(map(int, input().split()))

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
m = max(left)
for i in range(len(left)):
	left[i] = m - left[i]
res = left[0]
for c in left[1:]:
	res = gcd(res, c)
rest = []
m = max(left)
count = 0
for num in left:
	count += num // res
print(count, res)


from math import gcd
n = int(input())
arr = list(map(int, input().split(' ')))
maxV = max(arr)
cd = -1
maxNum = -1
for i in range(n):
	if arr[i] != maxV:
		maxNum = max(maxNum, arr[i])
		if cd != -1:
			cd = gcd(cd, maxV - arr[i])
		else:
			cd = maxV - arr[i]
dif = maxV - maxNum
if dif % cd > 0:
	maxV += cd - dif % cd
delta = maxV * n - sum(arr)
y = delta // cd
print(y, cd)


from math import gcd
n = int(input())
a = sorted(list(map(int, input().split())))
s = sum(a) - a[n - 1]
t = a[n - 1] * (n - 1)
ans = t - s
g = a[n - 1] - a[0]
for i in range(1, n - 1):
	g = gcd(a[n - 1] - a[i], g)
print(ans // g, g)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
s = 0
a = list(map(int, input().split()))
m = max(a)
res = m - a[0]
for c in range(n):
	a[c] = m - a[c]
	res = gcd(res, a[c])
for i in range(n):
	s = s + a[i] // res
print(s, res, end=' ')


import math
n = int(input())
string = input().split()
num = []
for i in string:
	num.append(int(i))
m = max(num)
d = 0
for i in range(n):
	d = math.gcd(d, m - num[i])
print(int((m * len(num) - sum(num)) / d), d)


import math
n = int(input())
a = list(map(int, input().split()))
y = 0
x = max(a)
g = max(a) - a[0]
for i in range(n):
	y += x - a[i]
	g = math.gcd(g, y)
print(y // g, g)


n = int(input())
l1 = list(map(int, input().split()))
maxii = max(l1)
l2 = []
for i in range(len(l1)):
	if maxii - l1[i] != 0:
		l2.append(maxii - l1[i])
if len(l2) > 1:

	def find_gcd(x, y):
		while y:
			(x, y) = (y, x % y)
		return x
	num1 = l2[0]
	num2 = l2[1]
	gcd = find_gcd(num1, num2)
	for i in range(2, len(l2)):
		gcd = find_gcd(gcd, l2[i])
else:
	gcd = l2[0]
zz = sum(l2)
print(zz // gcd, gcd)


n = int(input())
a = list(map(int, input().split()))
b = max(a)
d = 0
x = 0

def HCF(x, y):
	if x > y:
		smaller = y
		larger = x
	else:
		smaller = x
		larger = y
	while smaller > 0:
		(smaller, larger) = (larger % smaller, smaller)
	return larger
for i in a:
	d = HCF(d, b - i)
for i in a:
	x = x + b - i
x = x // d
print(x, d)


import math
n = int(input())
A = [x for x in map(int, input().split())]
a = 0
b = max(A)
B = [b - i for i in A]
gcd = B[0]
for i in range(n):
	gcd = math.gcd(gcd, B[i])
print(sum(B) // gcd, end=' ')
print(gcd)


import sys
from math import gcd

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
N = INT()
A = LIST()
mn = min(A)
A = [a - mn for a in A]
g = 0
for a in A:
	g = gcd(g, a)
if g == 0:
	print(0, g)
	exit()
mx = max(A)
sm = 0
for a in A:
	sm += (mx - a) // g
print(sm, g)


from collections import Counter
import string
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
testcases = 1
for _ in range(testcases):
	n = vary(1)
	num = array_int()
	maxi = max(num)
	sumt = []
	for i in num:
		if i != maxi:
			sumt.append(maxi - i)
	gd = sumt[0]
	ans = sumt[0]
	for i in range(1, len(sumt)):
		ans += sumt[i]
		gd = math.gcd(sumt[i], gd)
	print(ans // gd, gd)


import math
n = int(input())
L = list(map(int, input().split()))
maxl = max(L)
res = []
suma = 0
for x in L:
	if maxl - x != 0:
		res.append(maxl - x)
		suma += maxl - x
ans = res[0]
for r in res:
	ans = int(math.gcd(ans, r))
print(int(suma / ans), ans)


import os
from math import gcd
from functools import reduce

def f(arr):
	max_a = max(arr)
	diffs = []
	for a in arr:
		diffs.append(max_a - a)
	z = reduce(gcd, diffs)
	y = 0
	for diff in diffs:
		y += int(diff / z)
	return f'{y} {z}'
if os.environ.get('DEBUG', False):
	print(f'{f([3, 12, 6])} = 5 3')
	print(f'{f([2, 9])} = 1 7')
	print(f'{f([2, 1000000000, 4, 6, 8, 4, 2])} = 2999999987 2')
	print(f'{f([13, 52, 0, 13, 26, 52])} = 12 13')
else:
	input()
	arr = list(map(int, input().split()))
	print(f(arr))


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
ii = lambda : int(input())
kk = lambda : map(int, input().split())
ll = lambda : list(kk())

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
(i, ls) = (ii(), ll())
maxi = max(ls)
gc = -1
diffs = 0
for l in ls:
	if l == maxi:
		continue
	diff = maxi - l
	if gc == -1:
		gc = diff
	else:
		gc = gcd(gc, diff)
	diffs += diff
print(diffs // gc, gc)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
a = list(map(int, input().split()))
from functools import reduce
m = reduce(max, a)
z = reduce(gcd, (m - x for x in a))
y = sum(((m - x) // z for x in a))
print('%d %d' % (y, z))


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
dif = 0

def nsd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
for i in range(n - 1):
	if dif == 1:
		break
	if dif == 0:
		dif = a[i + 1] - a[i]
		continue
	rozdiel = a[i + 1] - a[i]
	if rozdiel % dif == 0:
		continue
	else:
		dif = nsd(dif, rozdiel)
out = 0
last = a[-1]
for i in range(n):
	out = out + (last - a[i]) // dif
print(out, dif)


from sys import stdin
from math import gcd
n = int(stdin.readline().strip())
s = list(map(int, stdin.readline().strip().split()))
s.sort()
mx = s[-1]
s1 = []
for i in range(n):
	s1.append(mx - s[i])
g = gcd(s1[0], s1[1])
for i in range(2, n):
	g = gcd(g, s1[i])
ans = mx * n - sum(s)
ans = ans // g
print(ans, g)


import math
n = int(input())
a = list(map(int, input().split()))
m = max(a)
d = []
for i in a:
	if i != m:
		d.append(m - i)
z = 0
for i in d:
	z = math.gcd(z, i)
y = 0
for i in d:
	y += i // z
print(y, z)


import sys
input = sys.stdin.readline
import math

def main():
	N = int(input())
	A = list(map(int, input().split()))
	A.sort()
	B = []
	Amax = A[-1]
	for i in range(N - 1):
		B.append(Amax - A[i])
	R = max(B)
	for b in B:
		if b != 0:
			R = min(R, b)
	prob = []
	for n in range(1, int(math.sqrt(R)) + 2):
		if R % n == 0:
			prob.append(n)
			prob.append(R // n)
	prob.sort(reverse=True)
	for p in prob:
		ok = True
		for b in B:
			if b % p != 0:
				ok = False
		if ok:
			z = p
			break
	y = 0
	for b in B:
		y += b // z
	print(y, z)
main()


import math
n = int(input())
num = list(map(int, input().split()))
num.sort()
mx = num[n - 1]
temp = []
for i in range(n - 1):
	v = num[i + 1] - num[i]
	if v > 0:
		temp.append(v)
if len(temp) == 1:
	gcd = temp[0]
else:
	gcd = math.gcd(temp[0], temp[1])
	for i in range(2, len(temp)):
		gcd = math.gcd(gcd, temp[i])
ans = 0
for i in range(n):
	ans += (mx - num[i]) // gcd
print(ans, gcd)


import math
elem = int(input())
ar = []
stolen = []
for t in input().split(' '):
	ar.append(int(t))
tempMax = max(ar)
for i in ar:
	stolen.append(tempMax - i)
curr = math.gcd(stolen[0], stolen[1])
for x in range(len(stolen)):
	if x == 0 or x == 1:
		continue
	else:
		curr = math.gcd(curr, stolen[x])
print(int(sum(stolen) / curr), curr)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
b = [m - i for i in a]
import math
j = b[0]
for i in b:
	j = math.gcd(i, j)
c = [i // j for i in b]
print(sum(c), j)


import sys
input = sys.stdin.readline

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
n = int(input())
a = list(map(int, input().split()))
M = max(a)
b = [M - ai for ai in a]
z = 0
for bi in b:
	z = gcd(z, bi)
y = 0
for bi in b:
	y += bi // z
print(y, z)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
m = max(a)
for i in range(0, n):
	a[i] = m - a[i]
s = gcd(a[0], a[1])
f = 0
for i in range(2, n):
	s = gcd(s, a[i])
for i in range(0, n):
	f += a[i] // s
print(f, s)


import sys
import os
from io import IOBase, BytesIO

def main():
	n = int(input())
	arr = get_array()
	mx = max(arr)
	cnt = 0
	from math import gcd
	g = 0
	diff = []
	for i in arr:
		cnt += mx - i
		if i != mx:
			diff.append(mx - i)
	if len(diff) == 0:
		print(0, 0)
		return
	for i in diff:
		g = gcd(g, i)
	ans = 0
	for i in range(n):
		if arr[i] != mx:
			ans += (mx - arr[i]) // g
	print(ans, g)
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip()
main()


import sys
import math
import collections
import bisect
import string

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(1):
	n = int(input())
	arr = get_list()
	ans = []
	maxim = max(arr)
	for i in range(n):
		val = maxim - arr[i]
		if val > 0:
			ans.append(val)
	if len(ans) == 1:
		gcd = ans[0]
	elif len(ans) == 2:
		gcd = math.gcd(ans[0], ans[1])
	else:
		gcd = math.gcd(ans[0], ans[1])
		for i in range(2, len(ans)):
			gcd = math.gcd(gcd, ans[i])
	number = sum(ans) // gcd
	print(number, gcd)


import math
q = int(input())
s = list(map(int, input().split(' ')))
x = max(s)
n = [0] * q
y = 0
for i in range(q):
	n[i] = x - s[i]
gcd = n[0]
for i in range(q - 1):
	gcd = math.gcd(n[i + 1], gcd)
for i in range(q):
	n[i] = n[i] // gcd
	y = n[i] + y
print(str(y) + ' ' + str(gcd))


import math

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
nums = sorted(list(map(int, input().split())), reverse=True)
mx = nums[0]
stnums = list(dict.fromkeys(nums))
(p, x) = (0, stnums[0] - stnums[1])
for i in range(n - 1):
	vl = gcd(nums[i] - nums[i + 1], x)
	x = min(x, vl)
for i in range(n):
	p += (mx - nums[i]) // x
print(p, x)


import math
n = int(input())
a = list(map(int, input().split()))
m = max(a)
c = []
for i in range(n):
	c.append(m - a[i])
b = list(set(a))
if len(b) > 2:
	t = c[0]
	for i in range(1, n):
		t = math.gcd(t, c[i])
	p = max(a)
	r = 0
	for i in range(n):
		r = r + c[i] // t
	print(r, t)
else:
	t = m
	s = min(a)
	p = a.count(s)
	print(p, t - s)


import math

def main():
	n = int(input())
	arr = list(map(int, input().split(' ')))
	if n == 2:
		z = max(arr) - min(arr)
		print(1, z)
	else:
		count = 0
		maxn = max(arr)
		val = maxn - arr[0]
		for i in range(1, n):
			val = math.gcd(val, maxn - arr[i])
		for i in range(n):
			count += (maxn - arr[i]) // val
		print(count, val)
main()


import math as mt
I = lambda : list(map(int, input().split()))
(n,) = I()
l = I()
s = sum(l)
d = max(l)
gc = d - l[0]
for i in l[1:]:
	gc = mt.gcd(gc, d - i)
print((d * n - s) // gc, gc)


import math
n = int(input())
a = list(map(int, input().split()))
ma = max(a)
c = []
for i in range(n):
	if ma != a[i]:
		c.append(ma - a[i])
GCD = c[0]
for i in range(1, len(c)):
	GCD = math.gcd(GCD, c[i])
if GCD == 0:
	GCD = 1
k = 0
for i in range(len(c)):
	k += c[i] // GCD
print(k, GCD)


from math import gcd
from functools import reduce
input()
a = list(map(int, input().split()))
ma = max(a)
z = reduce(gcd, [ma - x for x in a])
print(sum(((ma - x) // z for x in a)), z)


import sys
from math import ceil, gcd
input = sys.stdin.readline
n = int(input())
lis = list(map(int, input().split()))
m = max(lis)
diff = [m - lis[i] for i in range(n)]
g = 0
for i in range(n):
	g = gcd(g, diff[i])
ans = 0
for i in range(n):
	ans += diff[i] // g
print(ans, g)


from math import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
y = 0
z = []
for i in range(n - 1):
	z.append(abs(a[i] - a[i + 1]))
z = reduce(gcd, z)
mx = max(a)
for ai in a:
	y += (mx - ai) // z
print(y, z)


import sys
import math
input = sys.stdin.readline

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
diff = list()
for i in range(1, n):
	diff.append(arr[i] - arr[i - 1])
g = diff[0]
for i in range(len(diff)):
	g = gcd(g, diff[i])
z = g
if z == 0:
	z = arr[0]
maxim = arr[-1]
ans = 0
for i in range(n):
	ans += (maxim - arr[i]) // z
print(ans, z)


def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
arr = list(map(int, input().split()))
m = max(arr)
diffs = 0
gcd = 0
for i in arr:
	gcd = GCD(gcd, m - i)
	diffs += m - i
print(int(diffs / gcd), gcd)


n = int(input())
a = [int(i) for i in input().split()]
b = sum(a)
mx = max(a)
from math import sqrt
y = 10 ** 18
x = 10 ** 18

def check(y, x):
	for i in a:
		if (mx - i) % x != 0:
			return False
	return True
fc = n * mx - b
for yy in range(1, int(sqrt(fc)) + 1):
	if fc % yy == 0:
		if check(yy, fc // yy):
			if yy < y:
				y = yy
				x = fc // yy
		if check(fc // yy, yy):
			if fc // yy < y:
				y = fc // yy
				x = yy
print(y, x)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
mi = min(a)
for i in range(n):
	a[i] -= mi
ma = max(a)
g = gcd(a[0], a[1])
for i in range(2, n):
	g = gcd(g, a[i])
y = 0
for i in range(n):
	y += (ma - a[i]) // g
print(y, g)


def ma(a, b):
	if a > b:
		return a
	return b

def gcd(a, b):
	if a > b:
		return gcd(b, a)
	if a == 0:
		return b
	b = b % a
	a = a + b
	b = a - b
	a = a - b
	return gcd(a, b)
n = int(input())
a = list(map(int, input().split()))
m = a[0]
for i in a:
	m = ma(m, i)
gc = 0
for i in a:
	gc = gcd(gc, m - i)
result = 0
for i in a:
	result = result + (m - i) / gc
print(int(result), end=' ')
print(int(gc))


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
y = 0
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
gc = find_gcd(mx - a[0], mx - a[1])
y += mx - a[0] + mx - a[1]
for i in a[2:]:
	gc = find_gcd(gc, mx - i)
	y += mx - i
print(y // gc, gc)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
maxm = max(a)
li = []
for i in range(n):
	x = maxm - a[i]
	if x != 0:
		li.append(x)
g = li[0]
for x in li:
	g = gcd(g, x)
y = 0
for x in li:
	y += x // g
print(y, g)


import math
p = 0
s = 0

def delete(li, m):
	li2 = []
	for i in range(len(li)):
		if li[i] != m:
			li2.append(li[i])
	return li2

def gcdf(li, m):
	gcd = math.gcd(m - li[0], m - li[1])
	for i in range(len(li) - 2):
		gcd = math.gcd(gcd, m - li[i + 2])
	return gcd
t = int(input())
li = list(map(int, input().split()))
sum = sum(li)
max = max(li)
li = delete(li, max)
if len(li) == 0:
	p = 0
	s = 0
elif len(li) == 1:
	p = 1
	s = max - li[0]
else:
	s = gcdf(li, max)
	n = t * max
	p = (n - sum) / s
print(int(p), int(s))


from math import gcd

def agcd(arr):
	rets = arr[0]
	for i in arr:
		rets = gcd(i, rets)
	return rets
n = int(input())
a = [int(x) for x in input().split()]
m = max(a)
b = [m - i for i in a]
g = agcd(b)
s = sum([i // g for i in b])
print(s, g)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
ma = max(a)
y = 0
z = 0
for i in a:
	z = gcd(z, ma - i)
for i in a:
	y += (ma - i) // z
print(y, z)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
l = [int(i) for i in input().split()]
m = max(l)
d = [m - i for i in l]
g = 0
sm = sum(d)
for i in d:
	g = gcd(i, g)
print(sm // g, g)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
l = list(map(int, input().split()))
m = max(l)
z = 0
y = 0
for i in range(n):
	z = gcd(z, m - l[i])
for i in range(n):
	y += (m - l[i]) // z
print(y, z)


def gcd(a, b):
	if b:
		return gcd(b, a % b)
	else:
		return a
(n, a) = (int(input()), list(map(int, input().split())))
ans = 0
maxn = max(a)
b = []
for i in range(n):
	b.append(maxn - a[i])
for (i, x) in enumerate(b):
	ans = gcd(ans, x)
cnt = 0
for (i, x) in enumerate(b):
	cnt += x // ans
print(cnt, ans)


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def gcdL(l):
	while len(l) != 1:
		a = l.pop()
		b = l.pop()
		l.append(gcd(a, b))
	return l[0]
M = max(a)
l2 = [M - i for i in a if i != M]
tot = sum(l2)
small = gcdL(l2)
print(tot // small, small)


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from fractions import Fraction
import math

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)
from collections import defaultdict

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y, z) = mi()
		if x not in d:
			d[x] = [[z, y]]
		else:
			d[x].append([z, y])
		if y not in d:
			d[y] = [[z, x]]
		else:
			d[y].append([z, x])
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n + 1):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime
n = ii()
l = sorted(li())
count = [0] * (n - 1)
c = 0
for i in range(n - 1):
	count[i] = l[-1] - l[i]
	c += count[i]
x = count[0]
for i in range(1, n - 1):
	x = gcd(x, count[i])
print(c // x, x)


_ = input()
a = list(map(int, input().split()))
x = max(a)
new_a = list(map(lambda k: x - k, a))

def find_mud(l):
	if len(l) == 2:
		if l[1] == 0:
			return l[0]
		if l[0] == 0:
			return l[1]
		if l[0] > l[1]:
			l.reverse()
		return find_mud([l[1] % l[0], l[0]])
	cur = 0
	for el in l:
		cur = find_mud([cur, el])
	return cur
mud = find_mud(new_a)
print(sum(new_a) // mud, mud)


from math import gcd
n = int(input())
a_input = list(map(int, input().split()))
a = sorted(set(a_input))
offset = a[0]
cmax = a[len(a) - 1] - offset
all_gcd = 0
for k in a:
	all_gcd = gcd(k - offset, all_gcd)
missing = n * (cmax + offset) - sum(a_input)
print('%d %d' % (missing / all_gcd, all_gcd))


n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
s = sum(l)
theft = n * l[0] - s
rem = []
c = 0
for i in range(1, n):
	if l[0] - l[i] > 0:
		rem.append(l[0] - l[i])
		c += 1

def computeHCF(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
hcf = rem[0]
for i in range(1, c):
	hcf = computeHCF(hcf, rem[i])
print(theft // hcf, hcf)


import sys
r = lambda : sys.stdin.readline().rstrip()

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(r())
A = list(map(int, r().split()))
A.sort()
B = A.copy()
mn = A[0]
mx = A[-1]
G = 0
for i in range(n):
	curr = A.pop()
	G = gcd(G, curr - mn)
ans = 0
for i in B:
	ans += (mx - i) // G
print(ans, G)


import math
n = int(input())
c = [int(x) for x in input().split(' ')]
m = max(c)
a = -1
for i in range(1, n):
	if a == -1:
		if m - c[i - 1] == 0 and m - c[i] == 0:
			pass
		elif m - c[i - 1] == 0:
			a = m - c[i]
		elif m - c[i] == 0:
			a = m - c[i - 1]
		else:
			a = math.gcd(m - c[i - 1], m - c[i])
	elif m - c[i] != 0:
		a = math.gcd(a, m - c[i])
y = (m * n - sum(c)) // a
print(y, a)


def gcd(x, y):
	if x == 0:
		return y
	return gcd(y % x, x)

def gcd_l(arr):
	g = gcd(arr[0], arr[1])
	for i in range(2, len(arr)):
		g = gcd(g, arr[i])
	return g

def solve(arr):
	m = max(arr)
	p = len(arr)
	diff = [0] * p
	for i in range(p):
		diff[i] = m - a[i]
	g = gcd_l(diff)
	t = 0
	for x in diff:
		t += x // g
	return (t, g)
n = int(input())
a = list(map(int, input().split()))
(y, z) = solve(a)
print(str(y) + ' ' + str(z))


from math import gcd
from sys import stdin
input = stdin.readline
n = int(input())
a = list(map(int, input().split()))
maxa = max(a)
l = []
for i in range(n):
	if a[i] == maxa:
		continue
	else:
		l.append(maxa - a[i])
gcdl = l[0]
for i in range(len(l)):
	gcdl = gcd(l[i], gcdl)
ans = 0
for i in l:
	ans += i // gcdl
print(ans, gcdl)


import math
n = int(input())
max = 0
a = []
inp = input().split()
j = 0
for i in inp:
	a.append(int(i))
	if a[j] > max:
		max = a[j]
	j += 1
same_type = 0
total_stolen = 0
for i in range(n):
	stolen = max - a[i]
	total_stolen += stolen
	same_type = math.gcd(same_type, stolen)
total_robbers = total_stolen / same_type
print(int(total_robbers), same_type)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def multi_gcd(array: list) -> int:
	ans = array[0]
	for i in range(1, len(array)):
		ans = gcd(ans, array[i])
	return ans

def multi_lcm(array):
	ans = array[0]
	for i in range(1, len(array)):
		ans = ans * array[i] // gcd(ans, array[i])
	return ans
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
li_a = []
for i in range(n - 1):
	tmp = a[i + 1] - a[i]
	if tmp != 0:
		li_a.append(tmp)
gcd_a = multi_gcd(li_a)
max_a = max(a)
ans = 0
for i in range(n):
	ans += (max_a - a[i]) // gcd_a
print(ans, gcd_a)


import sys
import math
import random
import heapq
from collections import deque
input = sys.stdin.readline

def pow(a, n, m):
	if n == 0:
		return 1
	x = pow(a, n // 2, m)
	if n % 2 == 0:
		return x * x % m
	else:
		return x * x * a % m

def gcd(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a

def bs(arr, le, ri):
	l = 0
	arr.sort()
	r = len(arr) - 1
	ans = 10000000
	while l <= r:
		m = (l + r) // 2
		if arr[m] >= le and arr[m] <= ri:
			ans = arr[m]
			r = m - 1
		elif arr[m] < le:
			l = m + 1
		else:
			r = m - 1
	return ans
t = 1
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))
	m = max(a)
	for i in range(n):
		a[i] = m - a[i]
	g = 0
	for i in a:
		g = gcd(g, i)
	print(sum(a) // g, g)
	t -= 1


import sys, math
n = int(sys.stdin.readline())
arr = list(map(int, sys.stdin.readline().split()))
val = max(arr)
temp = [val] * n
res = []
for i in range(n):
	if arr[i] < val:
		res.append(abs(arr[i] - val))
res.sort()
ans = res[0]
for i in range(1, len(res)):
	ans = math.gcd(ans, res[i])
print(sum(res) // ans, ans)


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import math
n = int(input())
a = list(map(int, input().split()))
v = max(a)
a = [v - i for i in a if v - i != 0]
hcf = a[0]
for i in a[1:]:
	hcf = math.gcd(hcf, i)
z = hcf
y = sum([i // z for i in a])
print(y, z)


from sys import stdin, stdout
from math import gcd
(n, swords) = (int(input()), list(map(int, stdin.readline().split())))
swords.sort(reverse=True)
(y, z, tmp) = (0, 0, 0)
for i in range(1, n):
	tmp = swords[0] - swords[i]
	y += tmp
	z = gcd(z, tmp)
stdout.write('%d %d' % (y // z, z))


from sys import stdin, stdout
from math import gcd
for _ in range(1):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	mx = max(a)
	stolen = [mx - v for v in a if mx != v]
	hh = stolen[0]
	for v in stolen[1:]:
		hh = gcd(hh, v)
	ans = sum((v // hh for v in stolen))
	print(ans, sum(stolen) // ans)


import math
n = int(input())
list1 = [int(i) for i in input().split()]
max1 = max(list1)
gcd1 = max1 - list1[0]
for i in range(1, len(list1)):
	diff = list1[i] - list1[i - 1]
	gcd1 = math.gcd(gcd1, diff)
count = 0
sum1 = sum(list1)
diff = (max1 * len(list1) - sum1) // gcd1
print(diff, end=' ')
print(gcd1, end=' ')


from math import gcd
n = int(input())
s = list(map(int, input().split()))
x = max(s)
d = []
for i in range(n):
	if x != s[i]:
		d.append(x - s[i])
z = d[0]
for i in range(len(d)):
	z = gcd(d[i], z)
y = sum(d) // z
print(y, z)


def hcfnaive(a, b):
	if b == 0:
		return a
	else:
		return hcfnaive(b, a % b)
n = int(input())
l = list(map(int, input().split()))
m = max(l)
d = []
for i in range(n):
	if m - l[i] != 0:
		d.append(m - l[i])
if len(d) == 1:
	print(1, d[0])
else:
	g = d[0]
	for i in range(1, len(d)):
		g = hcfnaive(g, d[i])
	print(sum(d) // g, g)


from math import gcd
n = int(input())
l = list(map(int, input().split()))
z = max(l)
g = 0
count = 0
for i in l:
	if i != z:
		g = gcd(g, z - i)
	count += z - i
if len(set(l)) == 1:
	print(0, 0)
	exit()
if n == 2:
	if count != 0:
		print(1, count)
	else:
		print(0, count)
	exit()
print(count // g, g)


import math
n = int(input())
a = list(map(int, input().split()))
x = max(a)
temp = min(a)
z = x - temp
for i in range(n):
	if x - a[i] == 0:
		continue
	z = math.gcd(z, x - a[i])
y = 0
for i in range(n):
	y += (x - a[i]) // z
print(y, z)


N = int(input())
(*A,) = map(int, input().split())
S = sum(A)

def gcd(m, n):
	r = m % n
	return gcd(n, r) if r else n

def lcm(m, n):
	return m // gcd(m, n) * n
m = min(A)
M = max(A) - m
g = A[0] - m
for a in A[1:]:
	a -= m
	if a:
		if not g:
			g = a
			continue
		g = gcd(g, a)
rest = 0
for a in A:
	a -= m
	rest += M - a
print(rest // g, g)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
if n > 2:
	x = max(a)
	l = [x - a[0]]
	g = l[0]
	for i in range(1, n):
		l.append(x - a[i])
		g = gcd(g, l[i])
	print(sum(l) // g, g)
else:
	x = max(a)
	print(1, x - min(a))


from math import gcd
n = int(input())
a = list(map(int, input().split()))
maxim = max(a)
diff = [maxim - a[i] for i in range(n) if maxim - a[i] != 0]
g = diff[0]
for i in diff:
	g = gcd(i, g)
s = 0
for i in a:
	s += (maxim - i) // g
print(s, g)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(1):
		n = ri()
		a = ria()
		x = max(a)
		z = min(a)
		tsp = x * n
		tsn = sum(a)
		rs = tsp - tsn
		g = x - z
		for i in range(1, n):
			if a[i] != x:
				g = math.gcd(g, x - a[i])
		print(rs // g, g)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


import math
n = int(input())
a = [*map(int, input().split())]
max_a = max(a)
gcdarr = []
for i in range(n):
	if a[i] < max_a:
		gcdarr.append(max_a - a[i])
res = 0
for i in range(len(gcdarr)):
	res = math.gcd(res, gcdarr[i])
people = 0
for i in a:
	people += (max_a - i) // res
print(people, res)


import sys, math, queue
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
z = 0
for ai in a:
	z = math.gcd(z, mx - ai)
y = 0
for ai in a:
	y += (mx - ai) // z
print(y, z)


import math
n = int(input())
a = list(map(int, input().split()))
m = max(a)
z = 0
for ai in a:
	z = math.gcd(z, m - ai)
ppl = 0
for ai in a:
	ppl += (m - ai) // z
print(ppl, z)


import math
n = int(input(''))
a_list = list(map(int, input('').split(' ')))
sortedList = sorted(a_list)
reducedList = list(map(lambda x: x - sortedList[0], sortedList))
result = reducedList[0]
for i in reducedList[1:]:
	result = math.gcd(result, i)
y = 0
goal = reducedList[-1] // result
for i in reducedList:
	y += goal - i // result
print(y, end=' ')
print(result, end='')


import sys
import math
n = int(input())
a = [int(i) for i in input().split()]
sun = sum(a)
t = max(a)
f = 0
for i in a:
	f = math.gcd(f, t - i)
p = int((t * n - sun) / f)
print(p, f, sep=' ')


def gcd(a, b):
	if a is 0 or b is 0:
		return a + b
	tmp = 0
	while b is not 0:
		tmp = b
		b = a % b
		a = tmp
	return a
n = int(input())
a = list(map(int, input().split()))
a.sort()
mx_val = a[-1]
(remain, total) = (sum(a), mx_val * n)
common_gcd = 0
for i in a:
	common_gcd = gcd(common_gcd, mx_val - i)
print((total - remain) // common_gcd, common_gcd)


def gcd(a: int, b: int) -> int:
	return a if b == 0 else gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
m = max(a)
g = 0
s = 0
for x in a:
	s += m - x
	g = gcd(g, m - x)
print(s // g, g)


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
n = int(input())
levs = list(map(int, input().strip().split()))
dmax = max(levs)
shing = [dmax - i for i in levs if i != dmax]
zhing = [dmax - i for i in levs]
gd = shing[0]
for i in shing[1:]:
	gd = gcd(i, gd)
for i in range(len(zhing)):
	zhing[i] = int(zhing[i] / gd)
print(sum(zhing), ' ', gd)


ll = lambda : list(map(int, input().split()))
from fractions import gcd
from functools import reduce

def find_gcd(list):
	x = reduce(gcd, list)
	return x
testcases = 1
for _ in range(testcases):
	[n] = ll()
	a = ll()
	amax = max(a)
	l = []
	ans = 0
	for x in range(n):
		if not amax == a[x]:
			l.append(amax - a[x])
	h = find_gcd(l)
	for x in range(n):
		if not amax == a[x]:
			ans += (amax - a[x]) // h
	print(ans, h)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
maxm = max(a)
diff = []
for x in a:
	if x != maxm:
		diff.append(maxm - x)
g = diff[0]
for x in diff:
	g = gcd(g, x)
t = 0
for x in diff:
	t += x // g
print(t, g)


n = int(input())
swords = [int(i) for i in input().split()]

def mdc(a, b):
	resto = None
	while resto != 0:
		resto = a % b
		a = b
		b = resto
	return a
if n == 2:
	y = 1
	z = swords[1] - swords[0]
else:
	x = max(swords)
	robbed = []
	for i in range(n):
		robbed.append(x - swords[i])
	for i in range(n - 1, -1, -1):
		if robbed[i] == 0:
			del robbed[i]
	if len(robbed) == 1:
		y = 1
		z = robbed[0]
	else:
		z = mdc(robbed[0], robbed[1])
		i = 2
		for j in range(len(robbed) - 2):
			z = mdc(z, robbed[i])
			i += 1
		y = 0
		for i in range(n):
			y += (x - swords[i]) // z
print(y, z)


s = int(input())
li = list(map(int, input().split(' ')))
mn = min(li)

def mintwo(k):
	return k - mn
li = list(map(mintwo, li))
mx = max(li)

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
gcdk = li[0]
for i in range(1, len(li)):
	gcdk = gcd(li[i], gcdk)
ans = 0
for i in li:
	ans += (mx - i) // gcdk
print(ans, gcdk)


import math
n = int(input())
ar = list(map(int, input().split()))
z = abs(ar[1] - ar[0])
ma = max(ar[0], ar[1])
su = ar[0] + ar[1]
for i in range(2, n):
	z = math.gcd(z, abs(ar[i] - ar[i - 1]))
	su += ar[i]
	if ar[i] > ma:
		ma = ar[i]
print(abs(-(n * ma - su) // z), z)


import math
for _ in range(1):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	mx = max(l)
	sum1 = mx - l[0]
	gc = mx - l[0]
	for i in range(1, n):
		if mx - l[i] > 0:
			sum1 += mx - l[i]
			gc = math.gcd(gc, mx - l[i])
	print(sum1 // gc, gc)


n = int(input())
a = [int(_) for _ in input().split()]
shit = max(a)
l1 = []
ans = 0
for i in a:
	if shit - i != 0:
		l1.append(shit - i)
shit = min(l1)
factors1 = []
factors2 = []
for i in range(1, int(shit ** 0.5) + 2):
	if shit % i == 0:
		factors1.append(i)
		factors2.append(shit // i)
for i in factors2 + factors1[::-1]:
	for j in l1:
		if j % i != 0:
			break
	else:
		ans = i
		break
for i in range(len(l1)):
	l1[i] = l1[i] // ans
print(sum(l1), ans)


from math import gcd
from functools import reduce

def find_gcd(list):
	x = reduce(gcd, list)
	return x
n = int(input())
A = list(map(int, input().split()))
mn = max(A)
U = []
for j in A:
	if mn - j != 0:
		U.append(mn - j)
x = find_gcd(U)
res = sum(U) // x
ans = [res, x]
print(*ans)


from math import gcd as gcd
n = int(input())
a = [int(i) for i in input().split()]
m = max(a)
y = 0
g = 0
for i in a:
	g = gcd(g, m - i)
for i in a:
	y += (m - i) // g
print(int(y), int(g))


from fractions import gcd
from functools import reduce
n = int(input())
a = [int(x) for x in input().split()]
m = max(a)
t = reduce(gcd, map(lambda x: m - x, a))
y = sum(map(lambda x: (m - x) // t, a))
print(y, t)


from math import gcd
n = int(input())
a = [*map(int, input().split())]
M = max(a)
l = []
for i in a:
	if M - i > 0:
		l.append(M - i)
if not l:
	print(0, 0)
else:
	g = l[0]
	for i in l:
		g = gcd(g, i)
	y = z = 0
	for i in l:
		y += i // g
		z += i
	print(y, z // y)


import functools
import math

def soma(v, tam):
	sum = 0
	for x in range(tam):
		sum = sum + v[x]
	return sum
tamanho = int(input())
v = [int(i) for i in input().split()]
v.sort()
maior = v[tamanho - 1]
yz = maior * tamanho - soma(v, tamanho)
for w in range(tamanho):
	v[w] = maior - v[w]
y = functools.reduce(math.gcd, v)
z = int(yz / y)
print(z, y)


import math
import functools
qtd = int(input())
espadasqueficaram = list(map(int, input().split()))
clone = espadasqueficaram.copy()
maior = max(espadasqueficaram)
clone = [maior - x for x in clone if x != maior]
mdc = functools.reduce(math.gcd, clone)
total = 0
for x in clone:
	total += x // mdc
print(total, mdc)


from math import gcd
n = int(input())
l = list(map(int, input().split()))
ll = list(l)
m = max(l)
l[0] = m - l[0]
g = l[0]
for i in range(1, n):
	l[i] = m - l[i]
	g = gcd(g, l[i])
lol = 0
for i in l:
	lol += i // g
print(lol, g)


from math import gcd
from functools import reduce
N = int(input())
X = list(map(int, input().split()))
Max = max(X)
X = list(map(lambda x: Max - x, X))
GCD = X[0]
for i in X:
	GCD = gcd(GCD, i)
print(sum(X) // GCD, GCD)


import math
n = int(input())
s = list(map(int, input().split()))
s.sort()
q = 0
f = s[n - 1] - s[0]
for i in range(n - 1):
	q += s[n - 1] - s[i]
	if s[i] != s[n - 1]:
		f = math.gcd(f, s[n - 1] - s[i])
print(q // f, f)


from math import gcd
n = int(input())
arr = list(map(int, input().split()))
t = max(arr)
defs = []
ans = 0
for i in range(n):
	if arr[i] == t:
		continue
	else:
		defs.append(t - arr[i])
t = max(defs)
for i in range(len(defs)):
	t = gcd(t, defs[i])
for i in range(len(defs)):
	ans += defs[i] // t
print(ans, t)


import math
n = int(input())
s = list(map(int, input().split()))
z = abs(s[1] - s[0])
for i in s[1:]:
	z = math.gcd(z, abs(i - s[0]))
m = max(s)
y = (m * n - sum(s)) // z
print(str(y) + ' ' + str(z))


try:
	from string_source import string_source
	source = string_source('6\n13 52 0 13 26 52')
except ImportError:
	source = input
import math

def swords(a_left):
	m = max(a_left)
	a_stolen = [m - a for a in a_left]
	g = a_stolen[0]
	for a in a_stolen[1:]:
		if g == 1:
			break
		g = math.gcd(g, a)
	return (sum(a_stolen) // g, g)
source()
(people, sword_per_people) = swords(list(map(int, source().split(' '))))
print(people, sword_per_people)


import sys
from collections import defaultdict, deque
from math import sqrt, gcd

def input():
	return sys.stdin.readline()[:-1]
n = int(input())
a = [int(x) for x in input().split()]
mx = max(a)
a = [mx - x for x in a if mx - x != 0]
z = a[0]
for e in a:
	z = gcd(e, z)
y = 0
for e in a:
	y += e // z
print(y, z)


types = int(input())

def lcm(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
remain = list(map(int, input().split()))
max1 = max(remain)
lc = []
sum1 = 0
for i in range(len(remain)):
	if max1 - remain[i] != 0:
		lc.append(max1 - remain[i])
		sum1 += max1 - remain[i]
lc.sort()
lcm2 = lc[0]
if len(lc) > 1:
	for i in range(1, len(lc)):
		lcm2 = lcm(lcm2, lc[i])
a1 = sum1 // lcm2
print(a1, lcm2)


from math import gcd

def swords(n, lst):
	(m, c, tmp) = (max(lst), list(), 0)
	for i in range(n):
		c.append(m - lst[i])
	for i in range(len(c)):
		tmp = gcd(tmp, c[i])
	return (sum(c) // tmp, tmp)
m = int(input())
a = [int(j) for j in input().split()]
print(*swords(m, a))


from math import gcd
n = int(input())
a = list(map(int, input().split()))
b = min(a)
c = max(a)
d = 1
ans1 = 10 ** 18
ans2 = 10 ** 18
k = 0
for i in a:
	k += c - i
k1 = 0
for i in range(n):
	k1 = gcd(c - a[i], k1)
while d * d <= c - b:
	if k1 % d == 0:
		if k // d < ans1:
			ans1 = k // d
			ans2 = d
	if k1 % ((c - b) // d) == 0:
		if k // ((c - b) // d) < ans1:
			ans1 = k // ((c - b) // d)
			ans2 = (c - b) // d
	d += 1
print(ans1, end=' ')
print(ans2)


import math
n = int(input())
a = list(map(int, input().split()))
x = max(a)
y = z = 0
count = 0
v = []
for i in range(n):
	v.append(x - a[i])
for j in range(n):
	if v[n - j - 1] == 0:
		v.pop(n - j - 1)
for l in range(len(v)):
	count += v[l]
v.sort(reverse=True)
z = v[0]
for k in range(len(v) - 1):
	z = math.gcd(z, v[k + 1])
if z == 0:
	z = v[0]
y = count // z
print(y, z)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
result = 0
n = int(input())
swords = [int(i) for i in input().split()]
maxi = max(swords)
stolenTotal = 0
zeroes = 0
howManyCarried = []
for i in swords:
	if i != maxi:
		stolenTotal += maxi - i
		howManyCarried.append(maxi - i)
if len(howManyCarried) == 1:
	print(1, end=' ')
	print(howManyCarried[0])
elif len(howManyCarried) == 0:
	print('0 0')
else:
	result = gcd(howManyCarried[0], howManyCarried[1])
	for i in range(2, len(howManyCarried), 1):
		result = gcd(result, howManyCarried[i])
	print(stolenTotal // result, end=' ')
	print(result)


from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
m = max(a)
for i in range(n):
	a[i] = m - a[i]
g = a[0]
for i in range(1, n):
	g = gcd(g, a[i])
print(sum(a) // g, g)


def gcd(a, b):
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return max(a, b)
n = int(input())
a = list(map(int, input().split()))
maxi = -1
v = []
for i in a:
	maxi = max(i, maxi)
mdc = maxi - a[0]
for i in range(n):
	mdc = gcd(mdc, maxi - a[i])
soma = sum(a)
print(int((maxi * n - soma) / mdc), mdc)


from math import gcd
from functools import reduce

def find_gcd(lis):
	x = reduce(gcd, lis)
	return x

def answer(n, lis):
	sum_val = sum(lis)
	x = max(lis)
	new_lis = []
	while 1:
		for item in lis:
			new_lis.append(x - item)
		z = find_gcd(new_lis)
		y = int(sum(new_lis) / z)
		break
	return (y, z)
n = int(input())
lis = list(map(int, input().split()))
(y, z) = answer(n, lis)
print(y, ' ', z)


import math
n = int(input())
a = list(map(int, input().split()))
(m, s) = (max(a), 0)
g = m - a[0]
for i in a:
	l = m - i
	s += l
	g = math.gcd(g, l)
print(s // g, g)


from math import gcd
from functools import reduce
n = int(input())
sw = list(map(int, input().split()))
sw.sort()
tmp = [sw[i + 1] - sw[i] for i in range(n - 1)]
z = reduce(gcd, tmp)
m = max(sw)
y = 0
for s in sw:
	y += -(s - m) // z
print(y, z)


import math
n = int(input())
a = list(map(int, input().split()))
m = max(a)
numbers = []
for i in a:
	x = m - i
	if x != 0:
		numbers.append(x)
if len(numbers) == 0:
	print(0, 0)
if len(numbers) == 1:
	print(1, numbers[0])
else:
	gcd = math.gcd(numbers[0], numbers[1])
	for i in range(2, len(numbers)):
		gcd = math.gcd(gcd, numbers[i])
	result = 0
	for x in numbers:
		result += x // gcd
	print(result, gcd)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
a = list(map(int, input().split()))
a_max = max(a)
c = [a_max - a[i] for i in range(n)]
gcd = find_gcd(c[0], c[1])
for i in range(2, n):
	gcd = find_gcd(gcd, c[i])
print(sum([c[i] // gcd for i in range(n)]), end=' ')
print(gcd)


from math import gcd
input()
x = input()
x = [int(_) for _ in x.split()]
mm = max(x)
y = [mm - _ for _ in x if _ < mm]
gg = gcd(y[0], y[0])
for i in y:
	gg = gcd(gg, i)
print(sum(y) // gg, end=' ')
print(gg)


import math
n = int(input())
a = list(map(int, input().split()))
m = max(a)
if m == 0:
	print(0, 0)
else:
	g = 0
	cnt = 0
	for i in range(n):
		g = math.gcd(g, m - a[i])
		cnt += m - a[i]
	print(cnt // g, g)


from math import gcd
n = int(input())
arr = list(map(int, input().split()))
m = max(arr)
ans = []
for i in range(n):
	if m != arr[i]:
		ans.append(m - arr[i])
z = ans[0]
for i in range(1, len(ans)):
	z = gcd(ans[i], z)
y = sum(ans) // z
print(y, z)


import math, sys
from collections import Counter, defaultdict
from sys import stdin, stdout
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))

def find_lcm(num1, num2):
	p = num1 * num2
	return p // find_gcd(num1, num2)

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
a = li()
lcm = max(a)
gcd1 = find_gcd(a[0], a[1])
for i in range(2, n):
	if a[i] != 0:
		gcd = find_lcm(lcm, a[i])
	gcd1 = find_gcd(gcd1, a[i])
b = []
for i in range(0, n):
	b.append(lcm - a[i])
gcd = find_gcd(b[0], b[1])
for i in range(2, n):
	gcd = find_gcd(gcd, b[i])
print(sum(b) // gcd, gcd)


from math import gcd as _gcd

def gcd(args):
	acum = 0
	for ai in args:
		acum = _gcd(acum, ai)
	return acum
n = int(input())
a = [int(x) for x in input().split()]
mx = max(a)
z = gcd([mx - ai for ai in a])

def k(ai):
	return (mx - ai) // z
y = sum(map(k, a))
print(y, z)


def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
x = input()
x = list(map(int, input().split(' ')))
g = 0
s = 0
y = []
for i in range(len(x)):
	if x[i] > g:
		g = x[i]
for i in range(len(x)):
	if g != x[i]:
		y += [g - x[i]]
z = y[0]
for i in range(1, len(y)):
	z = GCD(y[i], z)
for i in range(len(y)):
	s += int(y[i] / z)
print(s, z)


import math
n = int(input())
l = list(map(int, input().split()))
z = max(l)
for t in range(n):
	l[t] = z - l[t]
s = sum(l)
gc = 0
for u in l:
	if u != 0:
		gc = u
		break
for i in l:
	if i != 0:
		gc = math.gcd(gc, i)
print(s // gc, gc)


def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	elif a % b == 0:
		return b
	else:
		return gcd(b, a % b)
n = int(input())
a = list(map(int, input().strip().split()))
c = max(a)
b = c - a[0]
for i in range(n - 1):
	b = gcd(b, c - a[i + 1])
d = 0
for i in range(n):
	d = d + (c - a[i]) // b
print(d, b)


from functools import reduce
from math import gcd
n = int(input())
a = [int(k) for k in input().split()]
sm = sum(a)
mx = max(a)
a.sort()
a = [mx - k for k in a[:-1]]
z = reduce(lambda u, v: gcd(u, v), a)
y = sum([k // z for k in a])
print(y, z)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
a.sort()
g = 0
for i in range(1, n):
	g = gcd(a[i] - a[i - 1], g)
y = 0
for i in range(n - 1, -1, -1):
	y += (a[-1] - a[i]) // g
print(y, g)


b = []
ans = 0

def Gcd(a, b):
	if b == 0:
		return a
	else:
		return Gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
maxi = max(a)
for i in range(n):
	b.append(maxi - a[i])
gcd = b[0]
for i in range(1, n):
	gcd = Gcd(gcd, b[i])
for i in range(n):
	ans += b[i] / gcd
print(int(ans), int(gcd))


from math import gcd
n = int(input())
arr = [int(x) for x in input().split()]
ans = 0
x = max(arr)
d = []
for a in arr:
	d.append(x - a)
z = 0
for dt in d:
	z = gcd(z, dt)
y = 0
for dt in d:
	y += dt // z
print(y, z)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
arr = list(map(int, input().split()))
maxx = max(arr)
lst = [maxx - i for i in arr]
num1 = lst[0]
num2 = lst[1]
gcd = find_gcd(num1, num2)
for i in range(2, n):
	gcd = find_gcd(gcd, lst[i])
cnt = 0
for i in lst:
	cnt += i // gcd
print(cnt, gcd)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
maxa = max(a)
r = [maxa - x for x in a]
z = r[0]
for i in range(1, n):
	z = gcd(z, r[i])
y = sum(r) // z
print(y, z)


def gcd(a, b):
	while a != 0 and b != 0:
		if a > b:
			a = a % b
		else:
			b = b % a
	return a + b
n = int(input())
s = list(map(int, input().split()))
s1 = []
mx = max(s)
sum = 0
for i in range(len(s)):
	if s[i] != mx:
		s1.append(mx - s[i])
		sum += mx - s[i]
if len(s1) > 1:
	t = gcd(s1[0], s1[1])
	for i in range(2, len(s1)):
		t = gcd(t, s1[i])
	print(sum // t, '', t)
else:
	print(1, '', sum)


fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from re import *
from sys import *
from math import *
from heapq import *
from queue import *
from bisect import *
from string import *
from itertools import *
from collections import *
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from collections import Counter as cc
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
n = int(z())
arr = zzz()
mx = max(arr)
lst = [mx - arr[i] for i in range(n)]
g = lst[0]
for i in lst[1:]:
	g = gcd(g, i)
print(sum(lst) // g, g)


from math import gcd
from functools import reduce
n = int(input())
a = [int(x) for x in input().split(' ')]
x = max(a)
taken = [x - k for k in a]
z = reduce(gcd, taken)
y = sum(taken) // z
print(y, z)


import functools
import math
n = int(input())
a = [int(i) for i in input().split()]
x = max(a)
roubadas = x * n - sum(a)
listaSub = list(map(lambda i: x - i, a))
z = functools.reduce(math.gcd, listaSub)
y = int(roubadas / z)
print(y, z)


import math
n = int(input())
swords = list(map(int, input().split()))
s = max(swords)
m = d = 0
for sword in swords:
	m += s - sword
	d = math.gcd(d, s - sword)
print(m // d, d)


def gcd(a, b):
	while b:
		a %= b
		(a, b) = (b, a)
	return a
n = int(input())
a = list(map(int, input().split()))
m = max(a)
ost = sum([m - a[i] for i in range(n)])
if ost != 0:
	tmp = m - a[0]
	for i in range(1, n):
		tmp = gcd(tmp, m - a[i])
	if tmp == 1:
		if n == 2:
			print(tmp, ost)
		else:
			print(ost, tmp)
	else:
		print(ost // tmp, tmp)
else:
	print(0, 0)


from sys import stdin, stdout
import math
n = int(stdin.readline())
arr = [int(x) for x in stdin.readline().split()]
res = 0
for i in range(1, len(arr)):
	res = math.gcd(res, arr[i] - arr[i - 1])
maxi = max(arr)
sumi = sum(arr)
z = res
y = int((maxi * n - sumi) / res)
stdout.write(str(y) + ' ' + str(z))


def nod(a, b):
	if a < b:
		(a, b) = (b, a)
	while b != 0:
		(a, b) = (b, a % b)
	return a
n = int(input())
a = [int(_) for _ in input().split()]
b = sorted(a, reverse=True)
m = b[0]
d = m - b[1]
for i in range(2, n):
	d = nod(d, m - b[i])
count = 0
for x in a:
	if x != m:
		count += (m - x) // d
print(count, d)


from math import gcd
n = int(input())
x = input().split(' ')
y = [int(i) for i in x]
m = max(y)
y = [m - i for i in y]
s = sum(y)
g = 0
for i in y:
	g = gcd(g, i)
print(s // g, g)


import math
inarr = lambda : map(int, input().split())
for _ in range(1):
	n = int(input())
	s = list(inarr())
	maxx = max(s)
	sum = 0
	ans = 0
	for i in s:
		x = maxx - i
		sum += x
		ans = math.gcd(ans, x)
	print(sum // ans, ans)


a = int(input())
l = list(map(int, input().split()))
m = max(l)
sp = []
for i in range(a):
	if l[i] != m:
		sp += [m - l[i]]
nod = sp[0]
for i in range(1, len(sp)):
	a1 = nod
	a2 = sp[i]
	while a1 > 0 and a2 > 0:
		if a1 > a2:
			a1 = a1 % a2
		else:
			a2 = a2 % a1
	nod = a2 + a1
res = 0
for i in range(len(sp)):
	res += sp[i] // nod
print(res, nod)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
arr = list(map(int, input().split()))
tsum = sum(arr)
maxarr = max(arr)
resgcd = 0
for i in range(n):
	resgcd = gcd(resgcd, maxarr - arr[i])
print(str((maxarr * n - tsum) // resgcd) + ' ' + str(resgcd))


from math import gcd
from sys import stdin

def arr_inp(n):
	if n == 1:
		return [int(x) for x in stdin.readline().split()]
	elif n == 2:
		return [float(x) for x in stdin.readline().split()]
	else:
		return list(stdin.readline()[:-1])
(n, a) = (int(input()), sorted(arr_inp(1)))
(g, ext) = (0, 0)
for i in range(n):
	g = gcd(g, a[-1] - a[i])
	ext += a[-1] - a[i]
print(ext // g, g)


from sys import stdin
from math import gcd, sqrt
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
n = I()
a = list(R())
m = max(a)
s = ans = 0
for i in a:
	p = m - i
	s += p
	ans = gcd(ans, p)
print(s // ans, ans)


def gcd(n1, n2):
	if n2 > n1:
		return gcd(n2, n1)
	if n2 == 0:
		return n1
	return gcd(n2, n1 % n2)

def check(x, arr):
	if x < max(arr):
		return (float('inf'), 0)
	n = len(arr)
	total = sum(arr)
	g = 0
	for i in arr:
		g = gcd(g, x - i)
	y = 0
	for i in arr:
		y += (x - i) // g
	total = n * x - total
	if total % y != 0:
		return (float('inf'), 0)
	return (y, total // y)

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	y = float('inf')
	z = 0
	low = 0
	high = 10 ** 15
	while low <= high:
		mid = low + (high - low) // 2
		(y1, z1) = check(mid, arr)
		if y1 != float('inf'):
			if y1 < y:
				y = y1
				z = z1
			high = mid - 1
		else:
			low = mid + 1
	print(y, z)
main()


import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
n = r()
a = rl()
maxi = max(a)
gc = maxi - a[0]
for i in range(1, n):
	gc = math.gcd(gc, maxi - a[i])
print((n * maxi - sum(a)) // gc, gc)


from math import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
m = max(a)
deltas = []
for i in range(n):
	deltas.append(m - a[i])
z = reduce(gcd, deltas)
y = int(sum(map(lambda x: x / z, deltas)))
print(y, z)


from math import gcd
n = int(input())
arr = list(map(int, input().split()))
max_num = max(arr)
summa = 0
for i in range(n):
	summa += arr[i]
g = max_num - arr[0]
for i in range(1, n):
	g = gcd(g, max_num - arr[i])
print((max_num * n - summa) // g, g)


import functools as f
n = int(input())
A = list(map(int, input().split()))
A.sort()
max_value = A[-1]
aa = []
result = 0
for el in range(n - 1):
	aa.append(abs(A[el] - max_value))
	result += abs(A[el] - max_value)
g = lambda a, b: a if b == 0 else g(b, a % b)
gcd = f.reduce(lambda x, y: g(x, y), aa)
print(result // gcd, gcd)


import sys
input = sys.stdin.readline
from math import gcd
n = int(input())
a = list(map(int, input().split()))
if n == 2:
	if a[0] == a[1]:
		print(0, 0)
		sys.exit()
	else:
		print(1, abs(a[0] - a[1]))
		sys.exit()
mx = max(a)
g = 0
for x in a:
	g = gcd(mx - x, g)
z = g
y = 0
for x in a:
	y += (mx - x) // z
print(y, z)


import math
n = int(input())
a = list(map(int, input().split()))
if n == 2:
	print(1, a[1] - a[0])
	quit()
y = max(a)
c = 0
sum1 = y * n - sum(a)
for i in range(0, len(a)):
	c = math.gcd(c, y - a[i])
print(sum1 // c, c)


from math import gcd
n = int(input())
l = list(map(int, input().split()))
l.sort()
if n == 2:
	if l[-1] > l[0]:
		print(1, l[-1] - l[0])
	else:
		print(0, 0)
else:
	mx = l[-1]
	g = mx - l[0]
	for i in range(1, n - 1):
		g = gcd(g, mx - l[i])
	cou = 0
	for i in range(n - 1):
		cou += (mx - l[i]) // g
	print(cou, g)


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = INT()
arr = LIST()
mx = max(arr)
for i in range(n):
	arr[i] = mx - arr[i]
g = gcd(arr[0], arr[1])
for i in range(2, n):
	g = gcd(g, arr[i])
cnt = 0
for i in range(n):
	cnt += arr[i] // g
print(cnt, g)


from math import *
n = int(input())
a = list(map(int, input().split()))
x = 0
z = max(a)
b = a[:]
for i in range(n):
	a[i] = z - a[i]
for i in a:
	x = gcd(x, i)
y = 0
for i in a:
	y += i // x
print(y, x)


def mdc(a, b):
	while b > 0:
		(a, b) = (b, a % b)
	return a
n = int(input())
lista_espadas = [int(c) for c in input().split()]
maior_valor = max(lista_espadas)
lista_roubadas = []
total_roubadas = 0
for espada in lista_espadas:
	lista_roubadas.append(maior_valor - espada)
	total_roubadas += maior_valor - espada
mdc_espadas = lista_roubadas[0]
for espada_roubada in lista_roubadas[1:]:
	mdc_espadas = mdc(mdc_espadas, espada_roubada)
print(total_roubadas // mdc_espadas, mdc_espadas)


import math
n = int(input())
a = list(map(int, input().split()))
v = max(a)
a = [v - i for i in a if v - i != 0]
hcf = a[0]
for i in a[1:]:
	hcf = math.gcd(hcf, i)
z = hcf
y = sum([i // z for i in a])
print(y, z)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
ans = a[1] - a[0]
for i in range(2, n):
	ans = gcd(ans, a[i] - a[i - 1])
y = 0
maxi = (a[-1] + ans - 1) // ans * ans
for e in a:
	y += (maxi - e) // ans
print(y, ans)


import math
n = int(input())
a = list(map(int, input().rstrip().split()))
max_no = max(a)
a[:] = [max_no - x for x in a]
g = a[0]
for j in range(n - 1):
	g = math.gcd(g, a[j + 1])
a[:] = [l // g for l in a]
print(sum(a), end=' ')
print(g)


from math import gcd
n = int(input())
l = list(map(int, input().split()))
m = max(l)
d = g = m - l[0]
for i in range(1, n):
	a = m - l[i]
	if m != l[i]:
		g = gcd(g, a)
	d += a
print(d // g, g)


r = int(input())
s = sorted(map(int, input().split()), reverse=1)
t = sorted(list(set(s)), reverse=1)
d = [t[i] - t[i + 1] for i in range(len(t) - 1)]

def h(a, b):
	while b != 0:
		temp = a % b
		a = b
		b = temp
	return a
if len(d) < 2:
	z = d[0]
else:
	z = h(d[0], d[1])
	if len(d) > 2:
		for i in range(2, len(d)):
			z = h(z, d[i])
y = int((s[0] * r - sum(s)) / z)
print(y, z)


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 6 + 1
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def mhd(a, b):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def eld(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
n = int(input())
a = arrIN()
mx = max(a)
cnt = 0
temp = []
for i in a:
	cnt += mx - i
	temp.append(mx - i)
g = lgcd(temp)
print(cnt // g, g)


def line():
	return map(int, input().split())

def num():
	return int(input())

def gcd(a, b):
	if b > a:
		return gcd(b, a)
	if b == 0:
		return a
	return gcd(b, a % b)
from functools import reduce
n = num()
a = list(line())
x = max(a)
sa = sum(a)
z = reduce(gcd, (x - ai for ai in a))
print((n * x - sa) // z, z)


from math import gcd
n = int(input())
a = [int(x) for x in input().split()]
mx = max(a)
s = sum(a)
d = mx - a[0]
for x in a:
	d = gcd(d, mx - x)
lost = mx * n - s
print(lost // d, d)


n = int(input())
A = list(map(int, input().split()))
A.sort()
import math
from functools import reduce

def gcd_list(numbers):
	return reduce(math.gcd, numbers)
B = [0] * (n - 1)
for i in range(1, n):
	B[i - 1] = A[i] - A[0]
g = gcd_list(B)
y = 0
for i in range(n):
	y += (A[-1] - A[i]) // g
print(y, g)


from functools import reduce
import math
n = int(input())
arr = list(map(int, input().split()))
sum_arr = sum(arr)
x = max(arr)
yz = n * x - sum_arr
for i in range(n):
	arr[i] = x - arr[i]
z = reduce(lambda i, j: math.gcd(i, j), arr)
ans = [yz // z, z]
print(*ans)


n = int(input())
A = list((int(i) for i in input().split(' ')))
A.sort()
max = A[-1]
stolenguns = 0
B = []
for i in range(n - 1):
	ele = max - A[i]
	stolenguns += ele
	B.append(ele)

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
if n > 2:
	g = gcd(B[0], B[1])
else:
	g = B[0]
for i in range(2, n - 1):
	g = gcd(g, B[i])
print(stolenguns // g, g)


import math
input()
a = (*map(int, input().split()),)
m = max(a)
s = d = 0
for x in a:
	s += m - x
	d = math.gcd(d, m - x)
print(s // d, d)


from math import *
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
m = max(a)
l = []
x = set()
for i in range(n):
	k = m - a[i]
	l.append(k)
	x.add(k)
x = list(x)
x.sort()
if len(x) == 1:
	s = x[0]
else:
	s = gcd(x[0], x[1])
	for i in range(1, len(x) - 1):
		d = gcd(x[i], x[i + 1])
		if d < s:
			s = d
c = 0
for i in range(1, n):
	c = c + l[i]
swo = s
man = c // s
print(man, swo)


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt, gcd
import unittest
from fractions import Fraction

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
n = read_int()
a = read_int_array()
a.sort(reverse=True)
if a[0] == 0:
	print('0 0')
	exit()
g = a[0] - a[1]
for i in range(2, n):
	g = gcd(g, a[0] - a[i])
x = a[0]
y = sum(((a[0] - a[i]) // g for i in range(1, n)))
print(y, g)


import math
n = int(input())
a = [int(i) for i in input().split()]
Max = 0
for i in a:
	Max = max(Max, i)
(s, z) = (0, 0)
for i in a:
	s += Max - i
	z = math.gcd(z, Max - i)
print(s // z, z)


import sys

def gcd(a, b):
	if a >= b:
		temp = 0
		while True:
			temp = a % b
			if temp == 0:
				return b
			a = b
			b = temp
	else:
		temp = 0
		while True:
			temp = b % a
			if temp == 0:
				return a
			b = a
			a = temp
n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))
a_dist = []
maxVal = max(a)
for i in range(n):
	a_dist.append(maxVal - a[i])
sumVal = sum(a_dist)
_gcd = 0
judge1 = False
for j in range(n):
	if judge1 == False and a_dist[j] != 0:
		_gcd = a_dist[j]
		judge1 = True
	if judge1 == True and a_dist[j] != 0:
		_gcd = gcd(_gcd, a_dist[j])
print(sumVal // _gcd, _gcd)


n = int(input())
lst = list(map(int, input().split()))
lst.sort()
(x, t, mx) = (lst[0], [], lst[0])
for i in range(1, n):
	y = lst[i]
	mx = max(mx, y)
	t.append(y - x)
	x = y
res = t[0]
from math import gcd
for i in range(1, n - 1):
	res = gcd(res, t[i])
result = 0
for (i, x) in enumerate(lst):
	result += (mx - x) // res
print(result, res)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
l = [int(y) for y in input().split()]
a = max(l)
z = []
for i in range(n):
	if l[i] != a:
		z.append(a - l[i])
gcd = z[0]
for i in range(1, len(z)):
	gcd = find_gcd(gcd, z[i])
ans = 0
for i in z:
	ans = ans + i // gcd
print(ans, gcd)


import math
n = int(input())
l = list(map(int, input().split()))
mx = max(l)
d = []
for i in l:
	if i != mx:
		d.append(mx - i)
s = 0
hcf = d[0]
for i in range(1, len(d)):
	hcf = math.gcd(hcf, d[i])
for i in d:
	s = s + i // hcf
print(s, hcf)


import math

def sol(n, ai):
	ai.sort(reverse=True)
	bi = [0] * n
	for i in range(n):
		bi[i] = ai[0] - ai[i]
	gcd = bi[1]
	for i in range(2, n):
		gcd = math.gcd(gcd, bi[i])
	y = 0
	for i in range(n):
		y = y + bi[i] // gcd
	return (y, gcd)
n = int(input())
ai = list(map(int, input().split(' ')))
(a, b) = sol(n, ai)
print(a, b)


def gcd(a, b):
	if a % b == 0:
		return b
	return gcd(b, a % b)
n = int(input())
arr = [int(x) for x in input().split()]
hash = {}
hcfarr = []
for i in arr:
	hash[i] = hash.get(i, 0) + 1
maximum = max(arr)
for i in hash.keys():
	if i != maximum:
		hcfarr.append(maximum - i)
ansgcd = hcfarr[0]
for i in range(1, len(hcfarr)):
	ansgcd = gcd(ansgcd, hcfarr[i])
sumall = 0
for i in arr:
	sumall += maximum - i
print(sumall // ansgcd, ansgcd)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
left = [int(x) for x in input().split()]
maxx = max(left)
taken = [maxx - x for x in left]
num1 = taken[0]
num2 = taken[1]
gcd = find_gcd(num1, num2)
for i in range(2, len(taken)):
	gcd = find_gcd(gcd, taken[i])
z = gcd
y = 0
for i in taken:
	y += i // z
print(y, z)


from math import gcd
n = int(input())
a = sorted(list(map(int, input().split())))
z = a[1] - a[0]
for i in range(2, n):
	z = gcd(z, a[i] - a[0])
y = sum([(a[-1] - a[i]) // z for i in range(n)])
print(y, z)


import math
sword_type = int(input())
left = list(map(int, input().split()))
maximum = max(left)
d = 0
swords_missing = 0
for i in left:
	swords_missing += maximum - i
	d = math.gcd(d, maximum - i)
print('{} {}'.format(int(swords_missing / d), d))


from math import gcd

def gcdl(l, n):
	if n == 1:
		return l[0]
	g = gcd(l[0], l[1])
	for i in range(2, n):
		g = gcd(g, l[i])
	return g
n = int(input())
a = list(map(int, input().split()))
m = max(a)
l = [m - i for i in a if i != m]
s = sum(l)
g = gcdl(l, len(l))
print(s // g, g)


from sys import setcheckinterval, stdin, setrecursionlimit
setcheckinterval(1000)
setrecursionlimit(10 ** 7)

def iin():
	return int(stdin.readline())

def lin():
	return list(map(int, stdin.readline().split()))
from math import gcd
n = iin()
a = lin()
sa = list(set(a))
sa.sort()
z = sa[1] - sa[0]
nn = len(sa)
for i in range(2, nn):
	z = gcd(sa[i] - sa[i - 1], z)
y = 0
mx = max(sa)
for i in a:
	y += (mx - i) // z
print(y, z)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
vals = list(map(int, input().split()))
vals.sort()

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
max1 = vals[-1]
z = max1 - vals[0]
for s in range(1, n):
	diff = max1 - vals[s]
	z = gcd(diff, z)
y = 0
for s in range(n):
	diff = max1 - vals[s]
	y += diff // z
print(y, z)


from math import gcd
from functools import reduce
L = int(input())
s = list(map(int, input().split(' ')))
ut = max(s)
R = [ut - x for x in s if x is not ut]
if len(R) > 1:
	curr = reduce(gcd, R)
else:
	curr = R[0]
s = sum([x for x in R])
print(int(s / curr), curr)


import math
n = int(input())
a = [int(x) for x in input().split()]
maxi = max(a)
z = maxi - a[0]
for i in range(1, n):
	z = math.gcd(z, maxi - a[i])
y = 0
for i in range(0, n):
	y += (maxi - a[i]) // z
print(y, z)


from sys import stdin, stdout
from os import path
rd = lambda : stdin.readline().strip()
wr = stdout.write
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
import time, math
from collections import defaultdict
x = int(rd())
mylist = list(map(int, rd().split()))

def gcd(x, y):
	if x == 0:
		return y
	return gcd(y % x, x)
if len(mylist) == 2:
	if mylist[0] == mylist[1]:
		y = 0
		z = 0
	else:
		y = 1
		z = abs(mylist[0] - mylist[1])
else:
	mx = max(mylist)
	mn = mx - mylist[0]
	sm = 0
	for i in range(len(mylist)):
		sm += mx - mylist[i]
		if mx == mylist[i]:
			continue
		else:
			mn = gcd(mx - mylist[i], mn)
	z = mn
	y = sm // mn
print(y, z)


import math
n = int(input())
(GCD, sum) = (0, 0)
s = input()
ara = [int(data) for data in s.split()]
Max = max(ara)
for data in ara:
	GCD = math.gcd(GCD, Max - data)
	sum += Max - data
print(int(sum / GCD), GCD)


import sys
input = sys.stdin.readline
from math import ceil, sqrt, gcd
n = int(input())
a = list(map(int, input().split()))
su = sum(a)
x1 = ceil(su / n)
x2 = max(a)
x = max(x1, x2)
r = x - a[0]
for i in range(1, n):
	r = gcd(r, x - a[i])
t = x * n - su
print(max(r, t) // min(r, t), end=' ')
print(min(r, t))


import math
n = int(input())
a = list(map(int, input().split()))
a.sort()
diff = []
for i in range(1, n):
	d = a[i] - a[i - 1]
	if d:
		diff.append(a[i] - a[i - 1])
gcd = diff[0]
for num in diff:
	gcd = math.gcd(num, gcd)
y = 0
for i in range(n):
	y += (a[-1] - a[i]) // gcd
print(y, gcd)


import math
x = int(input())
y = list(map(int, input().split()))
maxx = max(y)
ans = 0
ans1 = 0
for i in range(x):
	y[i] = maxx - y[i]
	ans = math.gcd(y[i], ans)
for i in range(x):
	ans1 += y[i] // ans
print(ans1, ans)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
input()
nums = [int(i) for i in str.split(input(), ' ')]
if len(nums) == 2:
	print(1, max(nums) - min(nums))
else:
	m = max(nums)
	rem = [m - n for n in nums]
	z = gcd(rem[0], rem[1])
	for i in range(2, len(rem)):
		z = gcd(z, rem[i])
	y = 0
	for n in nums:
		y += (m - n) / z
	y = int(y)
	print(y, z)


from functools import reduce
from math import gcd
n = int(input())
l = [*map(int, input().split())]
x = max(l)
z = reduce(gcd, [x - e for e in l])
y = (n * x - sum(l)) // z
print(y, z)


from math import gcd
n = int(input())
arr = list(map(int, input().split()))
maxi = max(arr)
add = maxi - arr[0] + maxi - arr[1]
gc = gcd(maxi - arr[0], maxi - arr[1])
for i in range(2, n):
	gc = gcd(gc, maxi - arr[i])
	add += maxi - arr[i]
print(add // gc, gc)


n = int(input())
s = list(map(int, input().split()))
s.sort()
maxm = s[n - 1]
ans = 0

def computeGCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
a = maxm - s[0]
for i in range(1, n - 1):
	a = computeGCD(a, maxm - s[i])
for i in range(0, n - 1):
	ans += maxm - s[i]
print(ans // a, a)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
b = [0] * (n - 1)
for i in range(n - 1):
	b[i] = a[i + 1] - a[i]
nd = b[0]

def nod(a, b):
	if b == 0:
		return a
	else:
		return nod(b, a % b)
for i in range(1, n - 1):
	nd = nod(nd, b[i])
ans = 0
for i in range(n):
	ans += (a[-1] - a[i]) // nd
print(ans, nd)


mod = 10 ** 9 + 7
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
from random import randint as rn

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	n = int(input())
	a = ain()
	a.sort()
	y = max(a)
	x = y - a[0]
	if x != 0:
		for i in range(1, n):
			if y - a[i] != 0:
				x = math.gcd(x, y - a[i])
		ans = 0
		for i in range(n):
			ans += (y - a[i]) // x
		print(ans, x)
	else:
		print(0, 0)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from math import gcd
n = int(input())
types = list(map(int, input().split(' ')))
m = max(types)
su = 0
g = 0
for aux in types:
	g = gcd(g, m - aux)
	su += m - aux
cake = 0 if g == 0 else su // g
print(*[cake, g])


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
a = list(map(int, input().split()))
maxe = 0
for e in a:
	maxe = max(maxe, e)
a.sort()
z = maxe - a[0]
for e in a:
	if e != maxe:
		z = gcd(z, maxe - e)
y = 0
for e in a:
	y += (maxe - e) / z
y = int(y)
print(y, z, end=' ')


import math
n = int(input())
a = list(map(int, input().split(' ')))
new = []
maxi = max(a)
for i in range(n):
	if maxi - a[i] == 0:
		continue
	else:
		new.append(maxi - a[i])
if len(new) == 0:
	z = 0
else:
	z = new[0]
	for i in range(1, len(new)):
		z = math.gcd(z, new[i])
y = sum(new) // z
print(y, z)


from math import gcd as g
a = int(input())
b = list(map(int, input().split()))
z = max(b)
gh = 0
r = []
for i in b:
	r += [z - i]
	gh = g(r[-1], gh)
print(sum((i // gh for i in r)), gh)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
diff = []
for i in a:
	if i != m:
		diff.append(m - i)
from functools import reduce
from math import gcd
g = reduce(gcd, diff)
y = 0
for i in diff:
	y += i // g
print(y, g)


from math import gcd
n = int(input())
a = list(map(int, input().split()))
if n == 1:
	print(0, 0)
elif n == 2:
	if max(a) - min(a):
		print(1, max(a) - min(a))
	else:
		print(0, 0)
else:
	b = max(a)
	s = b * n
	f = s - sum(a)
	gm = b - a[0]
	for i in range(1, n):
		gm = gcd(gm, b - a[i])
	print(f // gm, gm)


n = int(input())
l = list(map(int, input().split()))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
m = max(l)
k = [m - l[i] for i in range(n)]
g = k[0]
for i in range(1, n):
	g = gcd(g, k[i])
print(sum(k) // g, g)


import sys
from math import gcd

def rint():
	return map(int, sys.stdin.readline().split())
n = int(input())
a = list(rint())
b = []
amax = max(a)
for i in range(n):
	b.append(amax - a[i])
g = 0
for i in range(n):
	g = gcd(g, b[i])
y = 0
for i in range(n):
	y += b[i] // g
print(y, g)


from math import gcd
N = int(input())
sk = [int(x) for x in input().split()]
maz = min(sk)
sk = list(map(lambda x: x - maz, sk))
dbd = 0
did = max(sk)
for i in sk:
	dbd = gcd(dbd, did - i)
ats = 0
for i in sk:
	ats += (did - i) // dbd
print(ats, dbd)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
diff = 0
arr = []
for i in a:
	tmp = mx - i
	if tmp == 0:
		continue
	arr.append(tmp)
	diff += tmp
if len(arr) == 1:
	print('1', diff)
else:
	num1 = arr[0]
	num2 = arr[1]
	gcd = find_gcd(num1, num2)
	for i in range(2, len(arr)):
		gcd = find_gcd(gcd, arr[i])
	print(diff // gcd, gcd)


from math import gcd
from functools import reduce
n = int(input())
numbers = [int(k) for k in input().split(' ')]

def find_gcd(list):
	x = reduce(gcd, list)
	return x
if n == 2:
	print('1 ' + str(abs(numbers[1] - numbers[0])))
else:
	gc = find_gcd(numbers)
	maxi = max(numbers)
	t = 0
	px = []
	for k in numbers:
		r = int((maxi - k) / gc)
		if r > 0:
			px.append(r)
		t += r
	ng = find_gcd(px)
	if ng > 1:
		t = int(t / ng)
		gc = gc * ng
	print(t, gc)


import math
n = int(input())
a = list(map(int, input().split()))
aMax = max(a)
diff = list()
for v in a:
	diff.append(aMax - v)
y = math.gcd(diff[0], diff[1])
for i in range(n):
	y = math.gcd(y, diff[i])
z = 0
for v in diff:
	z += v // y
print(z, y)


import math
n = int(input())
arr = list(map(int, input().split()))
m = max(arr)
gcd = abs(arr[1] - arr[0])
for i in range(1, n):
	gcd = math.gcd(gcd, abs(arr[i] - arr[i - 1]))
tot = 0
for i in range(n):
	tot += m - arr[i]
print(tot // gcd, gcd)


import math
n = int(input())
arr = list(map(int, input().split()))
m = max(arr)
arr = [m - i for i in arr]
d = arr[0]
for i in arr:
	d = math.gcd(i, d)
print(sum(arr) // d, d)


import math
n = int(input())
nums = sorted(map(int, input().split(' ')), reverse=True)
max_num = nums[0]
for i in range(n - 1):
	cur_diff = nums[i] - nums[i + 1]
	if i == 0:
		g = cur_diff
	else:
		g = math.gcd(g, cur_diff)
y = 0
for i in range(1, n):
	y += max_num - nums[i]
y = y // g
z = g
out_txt = '%d %d' % (y, z)
print(out_txt)


from math import gcd
n = int(input())
a = [int(x) for x in input().split()]
boss = max(a)
arr = 0
g = 0
for i in range(n):
	a[i] = boss - a[i]
	g = gcd(g, a[i])
for item in a:
	arr += item // g
print(arr, g)


import math
n = int(input())
arr = list(map(int, input().split()))
maxi = max(arr)
new = []
for i in arr:
	if maxi - i != 0:
		new.append(maxi - i)
g = new[0]
for i in range(len(new)):
	g = math.gcd(g, new[i])
res = 0
for i in new:
	res += i // g
print(res, g)


import math
n = int(input())
tj = list(map(int, input().split()))
mx = max(tj)
for i in range(len(tj)):
	tj[i] = mx - tj[i]
y = 1
z = 0
if len(tj) == 1:
	z = tj[0]
	print(y, end=' ')
	print(z, end=' ')
elif len(tj) > 1:
	y = 0
	w = math.gcd(tj[0], tj[1])
	for i in range(len(tj) - 2):
		w = math.gcd(w, tj[i + 2])
	z = w
	for i in range(len(tj)):
		y += tj[i] // z
	print(y, end=' ')
	print(z, end=' ')
else:
	print('0 0')


import sys
input = lambda : sys.stdin.readline().strip()
from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
n = int(input())
ls = list(map(int, input().split()))
M = max(ls)
ls = [M - i for i in ls if i != M]
g = ls[0]
for i in ls:
	g = gcd(g, i)
l = 0
for i in ls:
	l += i // g
print(l, g)


from math import gcd
from functools import reduce

def find_gcd(list):
	x = reduce(gcd, list)
	return x
n = int(input())
a = list(map(int, input().split(' ')))
x = max(a)
temp = []
for i in range(0, n):
	temp.append(x - a[i])
z = find_gcd(temp)
y = (n * x - sum(a)) // z
print(y, z)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
no = list(map(int, input().split()))
m = max(no)
for i in range(n):
	no[i] = m - no[i]
arr = [x for x in no if x != 0]
g = []
if len(arr) - 1 > 0:
	for i in range(len(arr) - 1):
		g.append(gcd(arr[i], arr[i + 1]))
	m = min(g)
	for i in range(len(arr)):
		arr[i] //= m
	b = sum(arr)
else:
	m = arr[0]
	b = 1
print(b, m)


import sys, math, bisect
inf = float('inf')
mod = 10 ** 9 + 7

def lcm(a, b):
	return int(a / math.gcd(a, b) * b)

def gcd(a, b):
	return int(math.gcd(a, b))

def tobinary(n):
	return bin(n)[2:]

def binarySearch(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def lowerBound(a, x):
	i = bisect.bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def upperBound(a, x):
	i = bisect.bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def primesInRange(n):
	ans = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			ans.append(p)
	return ans

def primeFactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n = n // i
	if n > 2:
		factors.append(n)
	return factors
from collections import deque, defaultdict, Counter
import heapq
for _ in range(1):
	n = int(input())
	arr = list(map(int, input().split()))
	summ = sum(arr)
	ma = max(arr)
	g = ma - arr[0]
	for i in range(1, n):
		g = gcd(ma - arr[i], g)
	ans = (ma * n - summ) // g
	print(ans, g)


import math
n = int(input())
l = list(map(int, input().split()))
lcm = max(l)
s = lcm - l[0]
gcd = lcm - l[0]
for i in range(1, n):
	x = lcm - l[i]
	s = s + x
	gcd = math.gcd(gcd, x)
print(s // gcd, gcd, sep=' ')


import math
n = int(input())
a = list(map(int, input().split()))
k = max(a)
ans = 0
ans1 = 0
for i in range(n):
	a[i] = k - a[i]
	ans = math.gcd(a[i], ans)
for i in range(n):
	ans1 = ans1 + a[i] // ans
print(ans1, ans)


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
n = int(input())
a = sorted(list(map(int, input().split())))
if n == 2:
	print(1, a[1] - a[0])
else:
	t = a[n - 1] - a[0]
	for i in range(1, n):
		t = gcd(t, a[n - 1] - a[i])
	ans = 0
	for i in range(n - 1):
		ans += (a[n - 1] - a[i]) // t
	print(ans, t)


def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
arr = [int(i) for i in input().split()]
m = max(arr)
diff = []
for i in arr:
	diff.append(m - i)
gcd = find_gcd(diff[0], diff[1])
for i in diff:
	gcd = find_gcd(gcd, i)
z = gcd
s = sum(diff)
y = s // z
print(y, z)


from sys import *
from math import *
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
a.sort()
d = []
for i in range(n - 1):
	d.append(a[n - 1] - a[i])
z = d[0]
for i in range(1, n - 1):
	z = gcd(z, d[i])
t = sum(d)
y = t // z
print(y, z)


import datetime

def count_time(func):

	def int_time(*args, **kwargs):
		print('*' * 10, 'Code start running!')
		start_time = datetime.datetime.now()
		func()
		over_time = datetime.datetime.now()
		total_time = (over_time - start_time).total_seconds()
		print('*' * 10, 'Total time: %s' % total_time)
	return int_time

def gcd(a, b):
	if a % b == 0:
		return b
	else:
		return gcd(b, a % b)

def count(max_num, num):
	gcd_num = max_num - num[0]
	ans = 0
	for i in num:
		dif = max_num - i
		if dif == 0:
			continue
		gcd_num = gcd(gcd_num, dif)
	for i in num:
		ans += (max_num - i) // gcd_num
	return (max_num, ans, gcd_num)

def main():
	while True:
		try:
			T = int(input().strip())
			num = list(map(int, input().strip().split()))
			max_num = max(num)
			currect = count(max_num, num)
			print(currect[1], currect[2])
		except EOFError:
			break
main()


n = int(input())
arr = [int(i) for i in input().split()]
findMax = max(arr)
sum1 = 0

def gcd(a, b):
	return abs(a) if b == 0 else gcd(b, a % b)
for i in range(n):
	sum1 += arr[i]
z = findMax - arr[0]
data = []
data.append(z)
for j in range(1, n):
	z = gcd(z, findMax - arr[j])
	data.append(findMax - arr[j])
y = (findMax * n - sum1) / z
print(int(y), int(z))


def gcd(x, y):
	if y:
		return gcd(y, x % y)
	return x
n = int(input())
a = list(map(int, input().split()))
h = max(a)
g = 0
for x in a:
	g = gcd(g, h - x)
ans = 0
for x in a:
	ans += (h - x) // g
print(ans, g)


from math import gcd
n = int(input())
A = list(map(int, input().split()))
m = max(A)
g = 0
for i in A:
	g = gcd(g, m - i)
ans = 0
for i in A:
	ans += (m - i) // g
print(ans, g)


from math import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
m = max(a)
d = []
for i in a:
	if i != m:
		d.append(m - i)
r = reduce(gcd, d)
print(sum(d) // r, r)


def nod(a, b):
	if a > b:
		return nod(b, a)
	elif a == 0:
		return b
	else:
		return nod(b % a, a)
n = int(input())
s = list(map(int, input().split()))
m = max(s)
c = list(filter(lambda x: x > 0, map(lambda x: m - x, s)))
d = 0
for j in c:
	d = nod(d, j)
ans = 0
for j in c:
	ans += j // d
print(ans, d)


import math
from functools import reduce
_ = input()
s = input()
arr = list(map(int, str(s).strip().split(' ')))

def lcm(a, b):
	if a == 0:
		return b
	if b == 0:
		return a
	return a * b // math.gcd(a, b)
if len(arr) == 2:
	if arr[0] == arr[1]:
		print(0, 0)
	else:
		print(1, abs(arr[0] - arr[1]))
else:
	max_v = max(arr)
	for i in range(len(arr)):
		arr[i] = max_v - arr[i]
	nod = reduce(math.gcd, arr)
	nok = max((lcm(x, nod) for x in arr))
	count = 0
	for x in arr:
		count += x / nod
	if count == 0:
		nod = 0
	print(int(count), nod)