#H. JIXMPII5J0xE7UV#!/|
JIXMPII5J0xE7UV#!/|
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Statement
Danang and Darto are classmates. They are given homework to create a permutation of integers from to . Danang has completed the homework and created a permutation of integers. Darto wants to copy Danang's homework, but Danang asks Darto to change it up a bit so it does not look obvious that Darto copied.
The difference of two permutations of integers and , denoted by , is the sum of the absolute difference of and for all . In other words, . Darto would like to create a permutation of integers that maximizes its difference with . Formally, he wants to find a permutation of integers such that for all permutation of integers .
Darto needs your help! Since the teacher giving the homework is lenient, any permutation of integers is considered different with if the difference of and is at least . Therefore, you are allowed to return any permutation of integers such that .
Of course, you can still return if you want, since it can be proven that for any permutation and . This also proves that there exists a solution for any permutation of integers . If there is more than one valid solution, you can output any of them.
Format
Input
Input begins with a line containing an integer: ( ) representing the size of Danang's permutation. The next line contains integers: ( ) representing Danang's permutation. It is guaranteed that all elements in are distinct.
Output
Output in a line integers (each separated by a single space) representing the permutation of integers such that . As a reminder, all elements in the permutation must be between to and distinct.
Sample
4
1 3 2 4
4 2 3 1
2
2 1
1 2
ShanghaiTech ACM 炸鱼杯
- 状态
- 已结束
- 规则
- OI
- 题目
- 46
- 开始于
- 2024-12-10 23:00
- 结束于
- 2024-12-15 13:00
- 持续时间
- 110 小时
- 主持人
- 参赛人数
- 112