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
kapillamba4:
20170129 15:14:09
is it even possible to solve this problem in around 0.04 seconds ? how are the top guys able to do it, seems impossible to me :


jatin9533:
20170121 17:38:05
can anyone please explain the first two test cases i.e. for n=1 & n=2 

vunnamtej:
20170112 10:32:05
1.25s with bounds and 1.51s with binary search modified 

n963:
20161229 14:52:47
AC!! Last edit: 20170105 05:28:28 

Aditya krishna namdeo:
20161215 20:32:52
d!=0 :)


sas1905:
20161115 16:19:23
AC in first go..:) 

anroc:
20161108 23:26:41
shvkppl: binarysearch is just a way to solve it, and not the most efficient one, IMHO. 

shvkppl:
20161104 17:43:34
is this actually a binarysearch problem? 

adityaronanki:
20161020 15:51:50
can some one please explain me the question by solving a testcase manually....since i didnt understand the question


himanshi12:
20161013 14:06:16
Last edit: 20161013 14:06:54 
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 