#GL0000183. Không bị chia hết bởi phần tử khác (Not Divisible)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Không bị chia hết bởi phần tử khác (Not Divisible)
Not Divisible
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
You are given positive integers . An index is valid if there is no different index such that divides . Duplicate values are allowed and invalidate every occurrence of that value. Count the valid indices.
Input
The first line contains . The second line contains integers .
Output
Print the number of valid indices.
Subtasks
-
Subtask 1 (20 points): , .
-
Subtask 2 (30 points): , .
-
Subtask 3 (50 points): , .
Examples
Example 1
Input
5
24 11 8 3 16
Output
3
Explanation
Indices qualify, with values . The value is divisible by and , while is divisible by .
Example 2
Input
4
5 5 5 5
Output
0
Explanation
All four values equal . Each occurrence is divisible by the at another index, so none is valid.
Example 3
Input
10
33 18 45 28 8 19 89 86 2 4
Output
5
Explanation
The five valid values are . In contrast, is not valid because the array also contains .