#P16178. [ICPC 2014 NAIPC] GCDs
[ICPC 2014 NAIPC] GCDs
题目描述
Given a sequence of numbers, define , , as the Greatest Common Divisor of all the numbers through , inclusive. Note that and are indices, not members of the list. Given an array, considering all possible values of and , how many unique values of will there be?
输入格式
There will be several test cases in the input. Each test case will begin with a line with a single integer () representing the length of the sequence. The next lines will each have an integer (). These are the numbers in the sequence, in sequence order. The input will end with a line with a single 0.
输出格式
For each test case, output a single integer denoting the number of unique values can have for the input sequence. Do not output any spaces, and do not print any blank lines between answers.
2
4
6
3
3
6
8
0
3
5