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
p_kr: 2016-07-18 07:13:58

AC after 6 TLEs
-- used unordered_map, int instead of long long and two n^3 loops

baadshah_: 2016-07-15 18:57:50

Finally Got AC after Soooo many TLE
-->used long long only to store final ans
-->used STL sort() and vector
-->used lower_bound() and upper_bound()
-->used scanf()

Shubham Gupta: 2016-07-06 22:39:53

"d ! = 0" :)

kiwi1995: 2016-07-04 12:25:35

TLE :'(

mkfeuhrer: 2016-07-02 13:43:37

sort then lower bound then upper bound !! AC in 1 go :-)

hash7: 2016-07-02 07:44:27

fallen in love with binary search :D ...similar to sumfour

cat_got_bored: 2016-06-30 15:45:45

I hate SPOJ problems for these reasons , It's not about the algorithm I choose ,It's about how someone codes it, This is a easy problem but still getting nonsense TLE s. Waste of time!

hefuckusernam: 2016-06-28 16:15:14

Well quicksort is not fast enough.

abhigupta4: 2016-06-23 19:43:47

N^3 Solution AC with unordered_map.a*b + c fits in int.

Tushar Singh: 2016-06-23 07:09:14

Too much time invested... i just hope it was for a good cause! :/


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