Home STD Contest Notification Clarification Problems Ranklist Status Print Sign Out

Trap

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 124    Accepted Submission(s): 17


Problem Description
Avin is studying isosceles trapezoids. An isosceles trapezoid is a convex quadrilateral with two opposite parallel bases, two equal-length legs and positive area. In this problem, we further require that the two legs are not parallel. Given n segments, you are asked to find the number of isosceles trapezoids whose 4 edges are from these segments and the greatest common divisor of their lengths is 1. Two congruent isosceles trapezoids are counted only once.
 

Input
The first line contains a number n (4 ¡Ü n ¡Ü 2, 000). The second line contains n numbers, each of which represents the length of a segment (the length is within [2, 10000]).
 

Output
Print the number of non-congruent isosceles trapezoids.
 

Sample Input
5 4 4 2 8 9 6 4 4 4 2 8 9
 

Sample Output
2 3
 

Statistic | Submit | Clarifications | Back