#P17764. 「LDOI R2」极差 / Range
「LDOI R2」极差 / Range
Problem Description
Define the range of a sequence as the maximum value in the sequence minus the minimum value in the sequence.
You need to construct two permutations of length such that every subinterval of of length greater than has range greater than , every subinterval of of length greater than has range greater than , and for each position , the absolute difference between and is greater than .
Formally, it must satisfy the following conditions:
-
, .
-
, .
-
, .
If no such permutations exist, output .
Input Format
The input consists of a single positive integer .
Output Format
If no such permutations exist, output .
Otherwise, output two lines, each containing positive integers representing permutations and .
6
4 6 1 3 5 2
2 4 6 1 3 5
15
1 3 5 7 9 11 13 15 2 4 6 8 10 12 14
3 5 7 9 11 13 15 1 4 6 8 10 12 14 2
Hint
Constraints
This problem uses subtask scoring, and subtask dependency is enabled.
| Subtask | Score | Dependencies | |
|---|---|---|---|
| None | |||
For all test cases, .