#abc356a. A - Subsegment Reverse

A - Subsegment Reverse

Score : 100100 points

问题陈述

给定正整数 NNLLRR。 对于长度为 NN 的序列 A=(1,2,,N)A = (1, 2, \dots, N),执行了一次反转第 LL 个到第 RR 个元素的操作。 打印出执行此操作后的序列。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

You are given positive integers NN, LL, and RR.
For a sequence A=(1,2,,N)A = (1, 2, \dots, N) of length NN, an operation of reversing the LL-th through RR-th elements was performed once.
Print the sequence after this operation.

Constraints

  • All input values are integers.
  • 1LRN1001 \leq L \leq R \leq N \leq 100

Input

The input is given from Standard Input in the following format:

NN LL RR

Output

Let A=(A1,A2,,AN)A' = (A'_1, A'_2, \dots, A'_N) be the sequence after the operation. Print it in the following format:

A1A'_1 A2A'_2 \dots ANA'_N

Sample Input 1

5 2 3

Sample Output 1

1 3 2 4 5

Initially, A=(1,2,3,4,5)A = (1, 2, 3, 4, 5).
After reversing the second through third elements, the sequence becomes (1,3,2,4,5)(1, 3, 2, 4, 5), which should be printed.

Sample Input 2

7 1 1

Sample Output 2

1 2 3 4 5 6 7

It is possible that L=RL = R.

Sample Input 3

10 1 10

Sample Output 3

10 9 8 7 6 5 4 3 2 1

It is possible that L=1L = 1 or R=NR = N.