P7902 "PMOI-0" Fake Julian Day

Background

(Originally LZOI-1, renamed with the consent of PMOI members.) Lanuxhem heard that Yan Zhuo D solved **Julian Day** directly in the S-PSC exam room, and wanted to get the accepted code from Yan Zhuo D. But Yan Zhuo D did not want to give it to him, so Yan Zhuo D threw the following problem to Lanuxhem and said, "Solve this problem and I will give it to you." lhm-02

Description

Given a positive integer $n$ and another positive integer $d$. You need to construct a sequence $\{a_{2n}\}$ of length $2n$, satisfying: 1. Every number from $1$ to $n$ appears exactly $2$ times. 2. For a number $i$, if $i$ is odd, then the difference between the positions of its two occurrences **must** be greater than $d$. 3. For a number $i$, if $i$ is even, then the difference between the positions of its two occurrences **must not** be greater than $d$. Since Lanuxhem wants to get Yan Zhuo D's code but cannot solve this problem, he can only ask the smart you to help him finish it.

Input Format

The first line contains two integers $n$ and $d$.

Output Format

If there is no solution, output `-1`. Otherwise, output a sequence of length $2n$ as your answer. **If there are multiple solutions, any one of them will be accepted.**

Explanation/Hint

#### Sample Explanation The two occurrences of number $1$ are at positions $2,6$, with difference $4(>2)$. The two occurrences of number $3$ are at positions $1,4$, with difference $3(>2)$. The two occurrences of number $2$ are at positions $3,5$, with difference $2(\le2)$. #### Constraints **This problem uses bundled testdata.** | Subtask ID | Score | Special Constraint | | :-: | :-: | :-: | | $1$ | $36$ | $n\le10$ | | $2$ | $24$ | $d=\left\lfloor\dfrac{n}{2}\right\rfloor$ | | $3$ | $40$ | $\times$ | For $100\%$ of the testdata: $1\le\dfrac{d}{2}\le n\le10^6$。 Translated by ChatGPT 5