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:
20150729 01:25:53
equal_range in STL <3


Souvik Mondal :
20150727 14:58:12
Getting TLE on 11th case.O(n^3logn).any help? Last edit: 20150727 15:00:00 

Rahul Jain:
20150725 08:29:15
I think truncation(rounding up) is not allowed while dividing by 'd'. 

Liquid_Science:
20150624 20:42:22
In java problem shows NZEC instead of tle, whole day wasted _


sujit yadav:
20150612 21:07:54
very easy O(logn*n^3) AC !! :)


xxbloodysantaxx:
20150609 06:08:07
No STL s , simple implementation of Lower bound and upper bound :) 

Shubham Jalan:
20150516 10:56:29
TLE for std::map and ac for unordered_map! 

Menkov Andrey:
20150515 14:39:32
How can I know the number of test case on which my solution is failing?


alpha coder:
20150401 20:27:24
reduced it to o(n^3) using maps , still getting TLE 

swami:
20150305 19:23:27
in java im not sorting but using collections.frequency but getting tle for 11th case

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 