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
rohan_14:
20190215 18:23:40
Last edit: 20190215 18:24:07 

starun8795:
20190116 13:15:13
In 11th test case d=0 so don't forget to apply a check. 

rohitkk074:
20190113 11:56:14
AC in one go. 

md_meraj1319:
20181218 18:05:05
TO SOLVE THE PROBLEM ALL SEXTUPLES SHOULD BE GENERATED OR NOT? 

xandfury:
20181209 08:20:20
Last edit: 20181209 08:28:40 

jeeruajay:
20180821 09:19:28
how binary search works ? 

chandyshot:
20180819 04:40:27
Remember d!=0 

masterchef2209:
20180811 09:57:19
AC in one go, teaches complexity optimization using Meet in The Middle 

karan_yadav:
20180707 21:10:02
I thought it would be a binary search question (one with true false conditons) but this one uses binary search from STL : Last edit: 20180707 21:10:22 

ritesh31101998:
20180704 17:34:21
ac at 3rd go

Added by:  Luka Kalinovcic 
Date:  20090713 
Time limit:  0.360s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  own problem 