创想实验室
我们都是梦想家

Sort

描述

Given a sequence of n integers a1,a2,…,an and two integers L, R, please sort the subsequence aL,aL+1,…,aR in non-ascending order and output the sequence. Leave other parts of the sequence unchanged.

输入

In this problem each input may contain multiple test cases, and the rst line of the input contains a single integer T (1 ≤ T ≤ 100), the number of test cases. T test cases follow.

The  first line of each test case contains a single integer n (1 ≤ n ≤ 100), the length of the sequence.

The second line contains n space-separated integers, denoting a1,a2,…,an (0 ≤ ai ≤ 100, i = 1,2,…,n). The third and  nal line contains two integers L, R (1 ≤ L R n).

输出

For each test case, output a single line which contains n space-separated integers, denoting your answer. Please do NOT output any spaces at the end of the line.

样例输入

样例输出

题解

指定队列排序,可以用选择排序,冒泡排序,也可以用库中的sort

代码

 

网站所发布的代码已提交通过,代码可能经过修改防止抄袭,未经允许不得转载:创想实验室 » Sort
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址