## Triples

View as PDF

Points: 7
Time limit: 1.0s
Memory limit: 64M

Problem type

Given an array of integers, , compute the number of unique ways to satisfy the equation , where and . To be unique, each counted equation after being filled in must never have been counted before.

#### Input Specification

The first line will contain a single integer , .

The next line will contain space separated integers, describing the array.

#### Output Specification

The output will contain a single line, the number of unique triples that can be formed by the array.

#### Sample Input

4
1 5 3 2

#### Sample Output

2

#### Explanation for Sample

The unique equations are and