题目描述
xay has an array a of length n, he wants to know how many triples (i, j, k) satisfy ai×aj=akai×aj=ak。
输入描述:
The first line of input contains an integer n(1≤n≤1061≤n≤106).
The second line of input contains n integers a1,a2,⋯ ,ana1,a2,⋯,an(1≤ai≤1061≤ai≤106).
输出描述:
Print a single integer, indicates the number of triples.
示例1
输入
复制
3
1 1 1
输出
复制
27
示例2
输入
复制
5
1 2 4 8 16
输出
复制
15