ABCDEF  ABCDEF
You are given a set S of integers between 30000 and 30000 (inclusive).
Find the total number of sextuples that satisfy:
Input
The first line contains integer N (1 ≤ N ≤ 100), the size of a set S.
Elements of S are given in the next N lines, one integer per line. Given numbers will be distinct.
Output
Output the total number of plausible sextuples.
Examples
Input: 1 1 Output: 1 
Input: 2 2 3 Output: 4 
Input: 2 1 1 Output: 24 
Input: 3 5 7 10 Output: 10 
hide comments
xandfury:
20181209 08:20:20
Last edit: 20181209 08:28:40 

jeeruajay:
20180821 09:19:28
how binary search works ? 

chandyshot:
20180819 04:40:27
Remember d!=0 

masterchef2209:
20180811 09:57:19
AC in one go, teaches complexity optimization using Meet in The Middle 

karan_yadav:
20180707 21:10:02
I thought it would be a binary search question (one with true false conditons) but this one uses binary search from STL : Last edit: 20180707 21:10:22 

ritesh31101998:
20180704 17:34:21
ac at 3rd go


sharansh12:
20180607 10:33:25
my complexity is O(n^3*(log n)^2) how to reduce it? Last edit: 20180607 10:33:55 

techobist:
20180601 06:58:46
I didn't get how O(N^3 + hashing) > O(N^3*logN). Any help? 

vivek_dwivedi:
20180525 10:10:45
Can anyone help me to solve it faster . I got ac in 1 go but time was 2.38 sec . How even peoples have solved it in less than 0.1 sec . please help


ameyanator:
20180515 19:44:11
This question completely baffles me. First of all unordered_map works and map doesn't. why are you tagged #binarysearch then? Next unordered_multiset doesn't work but unordered_map does??!! why? 
Added by:  Luka Kalinovcic 
Date:  20090713 
Time limit:  0.360s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  own problem 