#abc286a. A - Range Swap
A - Range Swap
Score : points
问题描述
给定一个长度为 的序列 以及四个正整数 。 这里, 满足 且 。
令 为通过交换 中第 到第 项与第 到第 项所得到的新序列。 输出这个序列 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a sequence of length and positive integers , and .
Here, , and satisfy and .
Let be the sequence obtained by swapping the -th through -th terms and the -th through -th terms of .
Print the sequence .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print , with spaces in between.
Sample Input 1
8 1 3 5 7
1 2 3 4 5 6 7 8
Sample Output 1
5 6 7 4 1 2 3 8
Swapping the -st through -rd terms and the -th through -th terms of the sequence results in , which should be printed with spaces in between.
Sample Input 2
5 2 3 4 5
2 2 1 1 1
Sample Output 2
2 1 1 2 1
The same integer may occur multiple times in the sequence.
Sample Input 3
2 1 1 2 2
50 100
Sample Output 3
100 50
Sample Input 4
10 2 4 7 9
22 75 26 45 72 81 47 29 97 2
Sample Output 4
22 47 29 97 72 81 75 26 45 2
update @ 2024/3/10 11:56:57