#P1661. Q. Triangular Collection

Q. Triangular Collection

题目描述

Call a set of positive integers triangular if it has size at least three and, for all triples of distinct integers from the set, a triangle with those three integers as side lengths can be constructed.

Given a set of positive integers, compute the number of its triangular subsets

输入格式

The first line of input contains a single integer n(1n50)n (1 ≤ n ≤ 50), which is the number of integers inthe set. Each of the the next n lines contains a single integer x(1x109)x (1 ≤ x ≤ 10^9 ). These are the elements ofthe set. They are guaranteed to be distinct.

输出格式

Output a single integer, which is the number of triangular subsets of the given set.

样例

5 
3 
1 
5 
9 
10
2
10 
27 
26 
17 
10 
2 
14 
1 
12 
23 
39
58

提示

来源:牛客网

by 20王聪 录入