#abc215d. D - Coprime 2
D - Coprime 2
Score : points
问题描述
给定一个包含 个正整数的序列 ,找出满足以下条件的所有整数 ,其范围在 到 (包括两端点)之间:
- 对于每一个满足 的整数 ,有 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Given a sequence of positive integers , find every integer between and (inclusive) that satisfies the following condition:
- for every integer such that .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
In the first line, print : the number of integers satisfying the requirement.
In the following lines, print the integers satisfying the requirement, in ascending order, each in its own line.
Sample Input 1
3 12
6 1 5
Sample Output 1
3
1
7
11
For example, has the properties , so it is included in the set of integers satisfying the requirement.
On the other hand, has the property , so it is not included in that set.
We have three integers between and that satisfy the condition: , , and . Be sure to print them in ascending order.
update @ 2024/3/10 09:32:51