atcoder#AGC007B. [AGC007B] Construct Sequences
[AGC007B] Construct Sequences
Score : points
Problem Statement
You are given a permutation of the set {}. Please construct two sequences of positive integers , , ..., and , , ..., satisfying the following conditions:
- for all
- $a_{p_1}+b_{p_1} < a_{p_2}+b_{p_2} < ... < a_{p_N}+b_{p_N}$
Constraints
- is a permutation of the set {}
Input
The input is given from Standard Input in the following format:
Output
The output consists of two lines. The first line contains , , ..., seperated by a space. The second line contains , , ..., seperated by a space.
It can be shown that there always exists a solution for any input satisfying the constraints.
2
1 2
1 4
5 4
and . So this output satisfies all conditions.
3
3 2 1
1 2 3
5 3 1
3
2 3 1
5 10 100
100 10 1