Codeforces Round 298 (Div. 2)
A
Exam
Codeforces
1100
原题
←B →
翻译中…

An exam for $*n*$ students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers ($*i*$ and $*i* + 1$) always studied side by side and became friends and if they take an exam sitting next to each other, they will help each other for sure.

翻译中…

Your task is to choose the maximum number of students and make such an arrangement of students in the room that no two students with adjacent numbers sit side by side.

翻译中…

Input

翻译中…

A single line contains integer $*n*$ ($1 ≤ *n* ≤ 5000$) — the number of students at an exam.

翻译中…

Output

翻译中…

In the first line print integer $*k*$ — the maximum number of students who can be seated so that no two students with adjacent numbers sit next to each other.

翻译中…

In the second line print $*k*$ distinct integers $*a*_{1}, *a*_{2}, ..., *a*_{*k*}$ ($1 ≤ *a*_{*i*} ≤ *n*$), where $*a*_{*i*}$ is the number of the student on the $*i*$-th position. The students on adjacent positions mustn't have adjacent numbers. Formally, the following should be true: $|*a*_{*i*} - *a*_{*i* + 1}| ≠ 1$ for all $*i*$ from $1$ to $*k* - 1$.

翻译中…

If there are several possible answers, output any of them.

翻译中…

样例

Input #1
6
Output #1
6
1 5 3 6 2 4
InputCopy OutputCopy
Input #2
3
Output #2
2
1 3
InputCopy OutputCopy
题目信息
题号
534A
时间限制
1 s
内存限制
256 MB
标签
构造
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。