寻找一个 $1 \dots n$ 的排列,使得 $\prod_{i=1}^{n} \text{lcm}(p_i, p_{(i \bmod n) + 1})$ 最大。
输入格式
一个整数 $n$,满足 $n \le 10^5$。
输出格式
输出 $n$ 个整数,即为答案。
样例
样例输入 1
3
样例输出 1
1 2 3
样例输入 2
7
样例输出 2
1 2 3 4 5 6 7
寻找一个 $1 \dots n$ 的排列,使得 $\prod_{i=1}^{n} \text{lcm}(p_i, p_{(i \bmod n) + 1})$ 最大。
一个整数 $n$,满足 $n \le 10^5$。
输出 $n$ 个整数,即为答案。
3
1 2 3
7
1 2 3 4 5 6 7
The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.
This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.
If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.
Guidelines: