| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 | 2048 MB | 1 | 1 | 1 | 100.000% |
Given an array $a$ consisting of $n$ positive integers, find the number of quadruples of distinct indices $(i, j, k, l)$ such that the following fraction is irreducible:
$$\frac{a_i \cdot a_j}{a_k \cdot a_l}\text{.}$$
The first line contains an integer $n$ (4ドル \leq n \leq 2000$) denoting the length of the array. The second line contains $n$ integers $a_i$ (1ドル \leq a_i \leq 10^{12}$), the elements of the array.
Output a single integer: the number of quadruples satisfying the given condition.
4 1 1 1 1
24
6 10 11 2 4 5 7
96