PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000124. Đếm ước chung (Common Divisors)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm ước chung (Common Divisors)
Common Divisors
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers, a positive integer is called a common divisor if it divides every array element. Count the positive common divisors of the array.
Input
The first line contains ; the second contains integers .
Output
Print the number of positive common divisors.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
6
6 90 12 18 30 18
Output
4
Explanation
The six numbers have GCD 6, whose four positive divisors are 1, 2, 3 and 6.