Logo
(追記) (追記ここまで)

33341번 - Irreducible Fractions 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 2048 MB111100.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.

제한

예제 입력 1

4
1 1 1 1

예제 출력 1

24

예제 입력 2

6
10 11 2 4 5 7

예제 출력 2

96

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2023 > Day 2: Nyatl Contest 2023 I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /