시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 62 | 39 | 25 | 58.140% |
You are given a sequence of n integers a1, a2, ..., an. You should determine the number of such ordered pairs (i, j), that i, j ∈ {1, ..., n}, i ≠ j and ai is a divisor of aj.
The first line of input contains one integer n (1 ≤ n ≤ 2,000,000). The second line contains a sequence of n integers a1, a2, ..., an (1 ≤ ai ≤ 2,000,000).
In the first and only line of output should contain one integer, denoting the number of pairs sought.
5 2 4 5 2 6
6
There are 6 pars with the specified properties: (1, 2), (1, 4), (1, 5), (4, 1), (4, 2), (4, 5).