Points:
1700 (p)
Time limit:
1.0s
Memory limit:
512M
Input:
stdin
Output:
stdout
Given a list of \(n\) positive integers, your task is to count the number of pairs of integers that are coprime (i.e., their greatest common divisor is one).
Input
- The first input line has an integer \(n\): the number of elements.
- The next line has \(n\) integers \(x_1,x_2,\dots,x_n\): the contents of the list.
Output
- Print one integer: the answer for the task.
Constraints
- \(1\leq n\leq 10^5\)
- \(1\leq x_i\leq 10^6\)
Example
Sample input
8
5 4 20 1 16 17 5 15
Sample output
19
Comments
https://lqdoj.edu.vn/submission/4899501, if test
Bạn được cho một danh sách gồm \(n\) số nguyên dương, hãy đếm số cặp số nguyên tố cùng nhau (ước chung lớn nhất của chúng là một).
Hãy đếm trong \(n\) số nguyên dương đầu tiên, có bao nhiêu số chia hết cho ít nhất một số trong các số nguyên tố được cho.
Input
Output
Constraints
Example
Test 1
Input
Output
Note