AtCoder Regular Contest 198 (Div. 2)
翻译中…
Problem Statement
翻译中…
You are given a positive integer $N$. A set $S$ of positive integers between $1$ and $N$ (inclusive) is called a good set if it satisfies the following condition:
翻译中…
- For every pair of elements
$x$and$y$in$S$, the remainder when$x$is divided by$y$is not$1$.
翻译中…
Construct one good set with the maximum possible number of elements.
翻译中…
Constraints
翻译中…
$1 \le N \le 2 \times 10^{5}$
翻译中…
Input
翻译中…
The input is given from Standard Input in the following format:
翻译中…
N
翻译中…
Output
翻译中…
Let $k$ be the number of elements of the good set $S$ you constructed, and let $S = \lbrace S_1,S_2,\dots,S_k \rbrace$ be its elements. Output in the following format:
翻译中…
k
S_1\ S_2\ \dots\ S_k
翻译中…
If multiple solutions exist, any of them will be accepted.
翻译中…
样例
Input #1
5
Output #1
2
3 5
For example, $\lbrace 3,5 \rbrace$ and $\lbrace 2 \rbrace$ are good sets. On the other hand, $\lbrace 2,3,5 \rbrace$ and $\lbrace 1,2,3,4,5 \rbrace$ are not good sets.
No good set with three or more elements exists, so $\lbrace 3,5 \rbrace$ is one of the good sets with the maximum number of elements.
Input #2
2
Output #2
1
2
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。