Geometric Progression
시간 제한1초메모리 제한1024 MB
최대 백만 개의 정수가 엄격히 증가하는 수열로 주어질 때 i < j < k이고 a_i * a_k = a_j^2인 세 쌍의 개수를 센다. 값이 서로 다르다는 조건이 핵심이며, 중간항의 제곱 조건은 소인수분해로 다시 쓸 수 있다.
문제
bobo loves geometric progressions! So he wants to know the number of geometric progressions of length in a sequence .
That is to say, count the number of where and .
입력
The first line contains an integer ().
The second line contains integers ().
출력
A single integer denotes the number of geometric progressions.