問題一覧 > 通常問題

No.1146 Dogu I

レベル : / AI推定難易度 : 147 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 167
作問者 : okazakisteve / テスター : kozy
お気に入りにしたユーザー ProblemId : 4903 / 自分の提出
問題文最終更新日: 2020-08-05 18:06:06
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original

Problem Statement

$n$ dogu (clay figurines) are lined up in a row. Each dogu has a value called its "ID". Now, you want to choose 3 of the dogu and throw them away. However, the greatest common divisor of the IDs of the 3 dogu you throw away must be 1, or you will be cursed. You do not want to be cursed, so you need to choose the 3 dogu carefully. How many such ways of choosing are there?
For example, when the IDs of 3 dogu are 2,4,5 respectively, (2,5,4) and (2,4,5) are not distinguished.

Input

$n$
$a_1$
$a_2$
$.$
$.$
$.$
$a_n$

$3 \leq n \leq 100$
The ID of the $i \ (1 \leq i \leq n)$-th dogu is $a_i$. ($2 \leq a_i \leq 10^9$)
All inputs are integers.

Output

Output the number of ways to choose the dogu to throw away.
Print a newline at the end.

Sample

Sample 1
Input
3
5
7
8
Output
1

Sample 2
Input
6
2
4
6
8
10
100000
Output
0

You are destined to be cursed.

Sample 3
Input
13
810873207
437559198
824903876
399845588
927382663
413842030
854167730
733808844
798982702
1506167
352953250
191270287
464570933
Output
225

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。