INUM  Interesting Numbers
Jack and Jill went up the hill. Jack proposed Jill after reaching at the top of the hill. Jill gave Jack 'N' numbers and asked him to choose a pair of numbers such that their absolute difference is minimum. She also asked him to choose a pair of numbers such that their absolute difference is maximum. Jill wondered just finding maximum and minimum values is mainstream and it will be a cakewalk for Jack, instead she asked him to find number of pairs which have minimum absolute difference and number of pairs which have maximum absolute difference.
Jill will accept Jack's proposal only if he can answer her question correctly. Jack does not know programming. Fortunately Jack had his laptop with him, fully charged and with good internet connection. He mailed you the numbers and asked you to mail him the answers back, as you are known to be a good programmer. Now it's your turn to help him.
Input Format
First line contains a positive integer 'N'.
Next line contains 'N' nonnegative integers 'a[i]' separated by a single space.
Output Format
Print the number of pairs having minimum and maximum difference separated by a single space.
Constraints
1 ≤ N ≤ 105
0 ≤ a[i] ≤ 1015
Sample Input
5
5 12 8 1 35
Sample Output
1 1
Explanation
It's optimal to choose the pair (5, 8) for the minimum difference.So only 1 pair.
It's optimal to choose the pair (1,35) for the maximum difference. Here also only 1 pair.
hide comments
Snarl_jsb:
20160426 06:51:47
The problems say 1 ≤ N ≤ 10^5,but if we use int,we will get WA,Why? 

kartikay singh:
20150827 07:43:35
nice question..Used MAP :D


:.Mohib.::
20150609 04:29:32
Thnx @shashank ur cmnt help me....nice que!! 

Shashank Tiwari:
20150609 03:58:18
Let me explain this question ....


ashish jaiswal:
20150323 20:03:31
what wrong in my code??


Raghav Aggiwal:
20141017 14:13:46
8 Wa just because of taking one value in int instead of long long int .. BE CAREFUL 

Hasil Sharma:
20141007 15:00:34
@Aayush if it is total number of pairs, just like you said. Don't you think the sample input in incorrect ?


DEEPANSHU JAIN:
20140928 20:20:12
you should clearly mention whether in the pair (ar[i],ar[j]),i<=j, or n>=2..


DEEPANSHU JAIN:
20140928 20:18:45
Poor problem statement!!


shiv prasad chabarval:
20140928 11:13:34
@Aayush Agarwal please check why i am getting WA. i think my logic is right 
Added by:  Aayush Agarwal 
Date:  20140830 
Time limit:  1s2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  Own problem used for codecracker , coauthored by Rana Saha 