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
sarvagya: 2015-07-29 01:25:53

equal_range in STL <3
nice question!

Last edit: 2015-07-29 01:26:14
Souvik Mondal : 2015-07-27 14:58:12

Getting TLE on 11th case.O(n^3logn).any help?

Last edit: 2015-07-27 15:00:00
Rahul Jain: 2015-07-25 08:29:15

I think truncation(rounding up) is not allowed while dividing by 'd'.

Liquid_Science: 2015-06-24 20:42:22

In java problem shows NZEC instead of tle, whole day wasted -_-
please see into it.

sujit yadav: 2015-06-12 21:07:54

very easy O(logn*n^3) AC !! :)

xxbloodysantaxx: 2015-06-09 06:08:07

No STL s , simple implementation of Lower bound and upper bound :)

Shubham Jalan: 2015-05-16 10:56:29

TLE for std::map and ac for unordered_map!

Menkov Andrey: 2015-05-15 14:39:32

How can I know the number of test case on which my solution is failing?
I'm still getting WA and I don't know why. Check for d != 0 is already present.
Can I post here my solution for getting some help or ideas?
Thank you

alpha coder: 2015-04-01 20:27:24

reduced it to o(n^3) using maps , still getting TLE

swami: 2015-03-05 19:23:27

in java im not sorting but using collections.frequency but getting tle for 11th case

Last edit: 2015-03-05 19:32: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