#include <bits/stdc++.h>
using namespace std;
#define nl "\n"
#define el << endl
#define ll long long
// void doma()
// {
// ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
// #ifndef ONLINE_JUDGE
// freopen("output.txt", "w", stdout);
// #endif
// }
int main()
{
int n;
cin >> n;
ll array[n];
for (int i = 0; i <n; i++)
{
cin >> array[i];
}
ll minm = *min_element(array , array+n);
ll maxm = *max_element(array , array+n);
ll maximum_beauty = maxm - minm;
int count = 0;
for (int i = 0; i < n; i++)
{
for (int j = i+1; j < n; j++)
{
if(abs(array[i]-array[j]) == maximum_beauty ) count++;
}
}
cout << maximum_beauty << " " << count;
return 0;
}
/*
*/
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBubCAiXG4iCiNkZWZpbmUgZWwgPDwgZW5kbAojZGVmaW5lIGxsIGxvbmcgbG9uZwoKLy8gdm9pZCBkb21hKCkKLy8gewovLyAgICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSksIGNpbi50aWUoTlVMTCksIGNvdXQudGllKE5VTEwpOwovLyAjaWZuZGVmIE9OTElORV9KVURHRQovLyAgICAgIGZyZW9wZW4oIm91dHB1dC50eHQiLCAidyIsIHN0ZG91dCk7Ci8vICNlbmRpZgovLyB9CgppbnQgbWFpbigpCnsKICAgIGludCBuOwogICAgY2luID4+IG47CiAgICAgCiAgICBsbCBhcnJheVtuXTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDxuOyBpKyspCiAgICB7CiAgICAgICAgY2luID4+IGFycmF5W2ldOwogICAgfQoKICAgIGxsIG1pbm0gPSAqbWluX2VsZW1lbnQoYXJyYXkgLCBhcnJheStuKTsKICAgIGxsIG1heG0gPSAqbWF4X2VsZW1lbnQoYXJyYXkgLCBhcnJheStuKTsKICAgIGxsIG1heGltdW1fYmVhdXR5ID0gbWF4bSAtIG1pbm07CgogICAgaW50IGNvdW50ID0gMDsKCiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykKICAgIHsKICAgICAgICBmb3IgKGludCBqID0gaSsxOyBqIDwgbjsgaisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYoYWJzKGFycmF5W2ldLWFycmF5W2pdKSA9PSBtYXhpbXVtX2JlYXV0eSAgKSBjb3VudCsrOwogICAgICAgIH0KICAgICAgICAKCgogICAgfQogICAgCiAgICBjb3V0IDw8IG1heGltdW1fYmVhdXR5IDw8ICIgIiA8PCBjb3VudDsKCiAgICAKICAgIAoKCiAgICByZXR1cm4gMDsKfQoKLyoKCgoKKi8K