There are n cities situated along the main road of Berland. Cities are represented by their coordinates — integer numbers a_1, a_2, ..., a_{n}. All coordinates are pairwise distinct.

It is possible to get from one city to another only by bus. But all buses and roads are very old, so the Minister of Transport decided to build a new bus route. The Minister doesn't want to spend large amounts of money — he wants to choose two cities in such a way that the distance between them is minimal possible. The distance between two cities is equal to the absolute value of the difference between their coordinates.

It is possible that there are multiple pairs of cities with minimal possible distance, so the Minister wants to know the quantity of such pairs. 

Your task is to write a program that will calculate the minimal possible distance between two pairs of cities and the quantity of pairs which have this distance.


-----Input-----

The first line contains one integer number n (2 ≤ n ≤ 2·10^5).

The second line contains n integer numbers a_1, a_2, ..., a_{n} ( - 10^9 ≤ a_{i} ≤ 10^9). All numbers a_{i} are pairwise distinct.


-----Output-----

Print two integer numbers — the minimal distance and the quantity of pairs with this distance.


-----Examples-----
Input
4
6 -3 0 4

Output
2 1

Input
3
-2 0 2

Output
2 2



-----Note-----

In the first example the distance between the first city and the fourth city is |4 - 6| = 2, and it is the only pair with this distance.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
a = [int(x) for x in input().split()]
a.sort()

diffs = [a[i] - a[i-1] for i in range(1, n)]
diffs.sort()

cur = 0
while cur < n - 1 and diffs[cur] == diffs[0]:
    cur += 1
print(diffs[0], cur)


3
import sys

n = int(sys.stdin.readline())
a = [int(x) for x in sys.stdin.readline().split()]

a.sort()

count = 0
dist = float('inf')

for i in range(n - 1):
    d = a[i + 1] - a[i]
    if d < dist:
        dist = d
        count = 1
    elif d == dist:
        count += 1

print(dist, count)

n = int(input())
*l, = list(map(int, input().split()))
l.sort()
d = []
for i in range(n-1):
    d.append(l[i+1]-l[i])

print(min(d), d.count(min(d)))


n = int(input())
a = list(map(int, input().split()))
a.sort()
minm = 10000000000
mincount = 0
for i in range(n - 1):
    if a[i + 1] - a[i] == minm:
        mincount += 1
    elif a[i + 1] - a[i] < minm:
        minm = a[i + 1] - a[i]
        mincount = 1
print(minm, mincount)

import sys

def solve():
    n = int(input())
    a = sorted([int(i) for i in input().split()])

    cnt = 0
    min_d = 4 * 10**9

    for i in range(n - 1):
        if a[i + 1] - a[i] < min_d:
            cnt = 1
            min_d = a[i + 1] - a[i]
        elif a[i + 1] - a[i] == min_d:
            cnt += 1

    print(min_d, cnt)


def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def __starting_point():
    solve()
__starting_point()

n = int(input())
a = sorted([int(i) for i in input().split()])
m = abs(a[1] - a[0])
count = 0
for i in range(1, len(a)):
	t = abs(a[i] - a[i -1])
	if t < m:
		m = t
		count = 1
	elif t == m:
		count += 1
print(m, count)

n=int(input())
a=[int(i) for i in input().split()]
a.sort()
res=[]
for i in range(n-1):
    res.append(abs(a[i]-a[i+1]))
m=min(res)
c=0
for x in sorted(res):
    if x==m:
        c+=1
    else:
        break
print(m,c)


n = int(input())
a = list(map(int, input().split()))
a.sort()
m = a[1] - a[0]
cnt = 0
for i in range(1, len(a)):
    if a[i] - a[i - 1] == m:
        cnt += 1
    elif a[i] - a[i - 1] < m:
        m = a[i] - a[i - 1]
        cnt = 1
ans = str(m) + " " + str(cnt)
print(ans)

input()
a = sorted([int(i) for i in input().split()])
best = float('inf')
quantity = 0
for i in range(1, len(a)):
	diff = abs(a[i] - a[i - 1])
	if diff == best:
		quantity += 1
	elif diff < best: 
		quantity = 1
		best = diff
print(best, quantity)


from operator import sub
from bisect import bisect
n = int(input())
a = sorted(map(int, input().split()))
b = sorted(map(sub, a[1:], a))
d = b[0]
i = bisect(b, d)
print(d, i)


n = int(str(input()).strip())
a = sorted([int(x) for x in str(input()).split(' ')])
md = min([abs(a1 - a0) for a0, a1 in zip(a, a[1:])])
print(md, sum([md == abs(a1 - a0) for a0, a1 in zip(a, a[1:])]))


# - *- coding: utf- 8 - *-
"""
Created on Mon Mar 27 20:38:27 2017

Name: MD. Khairul Basar
Phone: 01760446942
Email: khairul.basar93@gmail.com
"""

n = int(input());
arr = list(map(int, input().split()));
arr = sorted(arr);

minimum = int(10000000000);
for i in range(n-1):
    if(arr[i+1] - arr[i] < minimum):
        minimum = arr[i+1] - arr[i];
count = 0;
for i in range(n-1):
    if(arr[i+1] - arr[i] == minimum):
        count+=1;
print(minimum,count);

def main():
    n = int(input())
    cities = list(map(int, input().split()))

    cities.sort()
    
    minimum = float('inf')
    count = 0

    for i in range(len(cities)-1):
        dif = abs(cities[i]-cities[i+1])
        if dif == minimum:
            count += 1
        elif dif < minimum:
            minimum = dif
            count = 1

    print(minimum, count)
        

def __starting_point():
    main()

__starting_point()

x=int(input())
y=input()
a=[int(i) for i in y.split()]
a.sort()
b=[]
i=0
while i<len(a)-1:
    b.append(abs(a[i]-a[i+1]))
    i+=1
print(min(b),b.count(min(b)))


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
r = []
for i in range(0, len(a) - 1):
    r.append(abs(a[i] - a[i + 1]))
r.sort()
print(r[0], r.count(r[0]))
    


N = int(input())
array = list(map(int, input().split()))
array.sort()
minimum = abs(array[0] - array[-1])
ans_amount = 0
for i in range (N - 1):
    if (array[i + 1] - array[i] < minimum):
        ans_amount = 1
        minimum = array[i + 1] - array[i] 
    elif (array[i + 1] - array[i] == minimum):
        ans_amount += 1
print(minimum, end = " ")
print(ans_amount)

n = int(input())
a = list(map(int, input().split()))
minimum = abs(a[0]-a[1])
counter = 0
a.sort()
for i in range(1, n-1):
    if abs(a[i]-a[i+1]) < minimum:
        minimum = abs(a[i]-a[i+1])
for i in range(n-1):
    if abs(a[i]-a[i+1]) == minimum:
        counter += 1
print(minimum, counter, sep=" ")

n = int(input())

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

a = sorted(a)

m = a[1]-a[0]

for i in range(2,len(a)):
    if a[i]-a[i-1] < m:
        m = a[i]-a[i-1]
 
count = 0
       
for i in range(1,len(a)):
    if a[i]-a[i-1] == m:
        count = count + 1
        
print(m,count)  

n = int(input())
a = sorted(map(int, input().split()))
count = 0
best = 2 * 10**9 + 1
for s1, s2 in zip(a, a[1:]):
    d = abs(s1 - s2)
    if d == best:
        count += 1
    elif d < best:
        count = 1
        best = d

print(best, count)

n=int(input())
l=list(map(int,input().split()))
l.sort()
m=3*1e9
nb=0
for i in range (len(l)-1):
    if l[i+1]-l[i]==m:
        nb+=1
    if l[i+1]-l[i]<m:
        m=l[i+1]-l[i]
        nb=1
print(m,nb,sep=' ',end='\n')


n =int(input())
tab = [int(i) for i in input().split()]
tab.sort()
dist = []
for i in range(n-1):
	dist.append(tab[i+1] - tab[i])
x = min(dist)
y = dist.count(x)
print(x, y)

n = int(input().strip())
arr = list(map(int, input().strip().split(" ")))

arr.sort()

minD = 3 * 10**9
for i in range(1, n):
    minD = min(minD, arr[i] - arr[i - 1])

count = 0
for i in range(1, n):
    if arr[i] - arr[i - 1] == minD:
        count += 1

print(minD, count)

n=int(input())
m=10**10
n=1
*a,=list(map(int,input().split()))
a.sort()
for i in range(1,len(a)):
    t=a[i]-a[i-1]
    if t<m:
        c=1
        m=t
    elif t==m:
        c+=1
print(m,c)


n=int(input())
L=input()
l=L.split()
l=[int(x) for x in l]
l.sort()
m=l[1]-l[0]
for i in range(n-1):
    if (l[i+1]-l[i])<m:
        m=(l[i+1]-l[i])
p=0
for i in range(n-1):
    if (l[i+1]-l[i])==m:
        p+=1
    
print (m,p,sep=" ")


n = int(input())
arr = list(map(int, input().split()))
arr = sorted(arr)
arr = [abs(arr[i] - arr[i + 1]) for i in range(n - 1)]
d = min(arr)
c = arr.count(d)

print(d, c)