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



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

hide comments
2014-08-24 16:29:36 Piyush Nirmal
Thanx@TYAGI..ur comment helped me gettin ac.
2014-05-01 20:00:01 Francis
hi everyone! I need your help.
My C code[n^3log(n)] with qsort always get TLE while the same cpp code with sort get AC in 6.86s. I read stackoverflow and get to know that sort(using introsort) in STL actually is faster than qsort. Also I know that there are a lot guys getting AC with C, some of which using qsort also got TLE. My question is how to amend the qsort function[like @(Tjandra Satria Gunawan)(曾毅昆) used a manual sort] to get AC in C????? or how to optimize my code to be lower than n^3log(n) so as to get AC in C?????
my C code is at .removed.
Any advice about this prob is welcome for me. Thx so much in advance! :):)
--edit+ans(Francky)-->Code links removed, it could be a spoil for others. qsort in C can be much slower than in cpp if input is made for that : the worst case for qsort is very slow, in cpp a little mix of data is done, then the same qsort avoid this worst case. Maybe a part of your answer, maybe not.
@Francky Thx for your answer,Francky! I know something about the difference actually. But I still do not know how to get AC in C. I tried qsort with insertion_sort and shell sort, still TLE.

Last edit: 2014-05-04 02:45:22
2014-03-21 01:59:34 TOTALED
what is the 11th test case getting wrong answer
2014-03-12 22:40:33 stranger
i have solved the problem but i still wondered how to optimize solution in order to pass it withtin 5 seconds. any ideas are welcome

Last edit: 2014-03-12 22:40:59
2014-02-12 23:48:00 TYAGI
during multiplication check for a[i] != 0....those who are getting wrong ans
2014-02-12 23:20:06 TYAGI
if vipul will do it ... he will comment...easy problem
2014-01-24 10:06:42 Abhinav Gupta
AC in first attempt!!.That too with Java!!
2014-01-24 05:22:59 RAHUL VERMA
WA after 11 th test case,,please help
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.