시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 2048 MB131251919.000%

문제

In the Shape Galaxy, where all shapes are sentient beings, there is currently a feud between circles and squares. Circles want all pathways to be flat while squares argue that they should be evenly spaced inverted catenary shaped bumps. Because of this feud, circles have begun to dislike all square-biased numbers. A number $s$ is square-biased if it is divisible by $x^2$, for some integer $x > 1$.

Mr. Circle has taken this feud to heart. He is given the assignment of calculating the greatest common divisor between all pairs of numbers in an array. He wants to go one step further and count the number of greatest common divisors that are not square biased.

입력

The first line of input contains a single integer, $n$ $(1 \le n \le 10^5)$, representing the length of the array of numbers.

The next $n$ lines contain the integers $a_i$ $(1 \le a_i \le 10^{12})$ which comprise the numbers in the array.

출력

Output a single integer, the number of pairs $(i, j)$ $(1 \le i < j \le n)$ such that $\gcd(a_i, a_j)$ is not square-biased.

예제 입력 1

6
3
4
6
12
4
1

예제 출력 1

12

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2024 ICPC Pacific Northwest Regional > Division 1 G번

  • 문제를 만든 사람: Jerry Li