

Time Limit: 2 sec / Memory Limit: 256 MB
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
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.
Sample Input 1Copy
2 1 2
Sample Output 1Copy
1 4 5 4
and . So this output satisfies all conditions.
Sample Input 2Copy
3 3 2 1
Sample Output 2Copy
1 2 3 5 3 1
Sample Input 3Copy
3 2 3 1
Sample Output 3Copy
5 10 100 100 10 1
配点 : 点
問題文
集合 {} の要素を並び替えた順列 が与えられます。以下の条件をすべて満たす つの正整数列 , , ..., および , , ..., を構成してください。
- すべての に対し、
制約
- は集合 {} の要素を並び替えた順列である。
入力
入力は以下の形式で標準入力から与えられる。
Output
行出力せよ。 行目に整数列 , , ..., を、 行目に整数列 , , ..., を、それぞれ空白区切りで出力せよ。
なお、制約を満たす任意の入力に対して解が存在することが示せる。
入力例 1Copy
2 1 2
出力例 1Copy
1 4 5 4
および より、すべての条件が満たされています。
入力例 2Copy
3 3 2 1
出力例 2Copy
1 2 3 5 3 1
入力例 3Copy
3 2 3 1
出力例 3Copy
5 10 100 100 10 1