[ABC342D] 完全平方乘积对 (Square Pair)
Score: points
Problem Statement
You are given a sequence of non-negative integers of length . Find the number of pairs of integers that satisfy both of the following conditions:
-
-
is a square number.
Here, a non-negative integer is called a square number when it can be expressed as using some non-negative integer .
Constraints
-
All inputs are integers.
-
-
Input
The input is given from Standard Input in the following format:
$N$
$A_1$ $\ldots$ $A_N$
Output
Print the answer.
Sample Input 1
5
0 3 2 8 12
Sample Output 1
6
Six pairs of integers, , satisfy the conditions.
For example, , and is a square number, so the pair satisfies the conditions.
Sample Input 2
8
2 2 4 6 3 100 100 25
Sample Output 2
7