Codeforces Round 442 (Div. 2)
C
Slava and tanks
Codeforces
1600
原题
← BD →
翻译中…

Slava plays his favorite game "Peace Lightning". Now he is flying a bomber on a very specific map.

翻译中…

Formally, map is a checkered field of size $1 × *n*$, the cells of which are numbered from $1$ to $*n*$, in each cell there can be one or several tanks. Slava doesn't know the number of tanks and their positions, because he flies very high, but he can drop a bomb in any cell. All tanks in this cell will be damaged.

翻译中…

If a tank takes damage for the first time, it instantly moves to one of the neighboring cells (a tank in the cell $*n*$ can only move to the cell $*n* - 1$, a tank in the cell $1$ can only move to the cell $2$). If a tank takes damage for the second time, it's counted as destroyed and never moves again. The tanks move only when they are damaged for the first time, they do not move by themselves.

翻译中…

Help Slava to destroy all tanks using as few bombs as possible.

翻译中…

Input

翻译中…

The first line contains a single integer $*n*$ ($2 ≤ *n* ≤ 100 000$) — the size of the map.

翻译中…

Output

翻译中…

In the first line print $*m*$ — the minimum number of bombs Slava needs to destroy all tanks.

翻译中…

In the second line print $*m*$ integers $*k*_{1}, *k*_{2}, ..., *k*_{*m*}$. The number $*k*_{*i*}$ means that the $*i*$-th bomb should be dropped at the cell $*k*_{*i*}$.

翻译中…

If there are multiple answers, you can print any of them.

翻译中…

样例

Input #1
2
Output #1
3
2 1 2
InputCopy OutputCopy
Input #2
3
Output #2
4
2 1 3 2
InputCopy OutputCopy
题目信息
题号
877C
时间限制
2 s
内存限制
256 MB
标签
构造

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