Type: Default 1000ms 256MiB

排列

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

翻译自 CSES-1070 题。

题目描述

一个包含数字 1,2,,n1,2,\cdots,n 并且每个数组恰好出现一次的排列称为是「美丽的」,当且仅当排列中没有任何相邻的元素,它们的差值是 11

给定一个整数 nn,问是否存在一个「美丽的」排列。

输入格式

输入一个正整数 nn

输出格式

如果存在「美丽的」排列,那么输出任意一种可能的结果。否则直接输出 NO SOLUTION

样例

5
4 2 5 3 1
3
NO SOLUTION

说明/提示

1n1061\le n \le 10^6

系统小测试

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2025-9-10 19:30
End at
2025-9-10 21:30
Duration
2 hour(s)
Host
Partic.
1