#664. 最大最小的位置交换

最大最小的位置交换

Description

image.png

Input Format

如题所述

Output Format

如题所述

5
1 2 5 3 4 
5 2 1 3 4
6
7 4 5 8 1 9
7 4 5 8 9 1