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
thelegend2710:
20210219 08:56:29
How does this uses binary search?


kya_bantai:
20201203 16:16:38
mappp 

kanishkverma_1:
20201128 11:09:08
simple brute force with hashmap , handle the d == 0 case explicitly


lamda_cdm_10:
20201120 17:22:16
AC in one go... A beautiful question, try solving the "4 SUM 0" problem first, and then try this one. Last edit: 20201120 17:23:21 

legion0retr0:
20200816 15:54:22
Probably hashmap should also be a added as a tag 

wille_25:
20200731 18:07:13
solve SUMFOUR problem ..similar to this; 

wille_25:
20200731 18:06:03
finally AC using vector ,sorting , lower_bound & upper_bound..but it took 2+ sec...& time limit is 1sec; 

jha_saurav:
20200609 19:08:06
getting TLE while using python help!! 

jintu_133:
20200527 20:09:19
A very nice problem! 

tarun_28:
20200523 16:54:19
after 4 months, i tried this problem again..but this time i used vectors..

Added by:  Luka Kalinovcic 
Date:  20090713 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  own problem 