2303 - I2P(I)2020_Chen_HW5 Scoreboard

Time

2021/04/06 21:30:00 2021/04/13 23:59:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12127 too many words
12661 The night's watch

12127 - too many words   

Description

Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas just got some writing homework to do.

His teacher gave him some texts, then asked him to write all of these texts once, and by hand.

However, Osas wants to cheat, so he ask you to write a program to repeat these texts exactly once so that he can just print them onto an A4 paper and turn in the homework easily.

(Although you know that finish the work by computer and printer, he will definitely get a ZERO, however, you still have to complete your task to get your AC.)

 

Input

The input contains a lot of texts. You don't know when will the text ends, but you know that there must be EOF at the end of the input.

And you know that the total amount of characters won't exceed 107.

Output

Print exactly the same as the input, even spaces and wraps('\n').

 

Sample Input  Download

Sample Output  Download

Tags




Discuss




12661 - The night's watch   

Description

And now my watch begins.

~by a binge watching man

Your a lord commander of the night's watch. You wants to choose some men to be your soldiers while other lords also needs to choose some men. There're n lords and n soldiers and there're k lords who are your friends therefore they will follow your order. And each soldier's ability is represented by a number ai. Since the lords stand in a line and wait for their turn to choose, you are standing in the m-th position.


Given a sequence of numbers a1 ~ an. n people standing in a line to choose one number from the sequence.

Each person can only choose a number from the head or the tail of the sequence.

Once a number is chosen, it will be remove from the sequence.

You are at m-th position of the line.

You want to get the number as big as possible.

You can command at most k people to choose what you want them to choose(head or tail).

But you can not change your command during the choosing process.

And those who you don't give a command will choose arbitrarily.

Your task is to find out what is the greatest integer x such that, no matter what are the choices of the others you didn't choose to control, the element you will take from the array will be at least x?

 

Example:

If there are n=6 numbers 2, 9, 2, 3, 8, 5.

You are at m=4 position.

And you can control k=2 people.

If the first person ordered by you choose tail 5.

The second person ordered by you choose head 2.

Then the third person can choose either 9 or 8.

No matter what the third person choose, you can get at least 8.

Therefore the answer is 8.

Input

The first line of input will be t(1 <= t <= 10) means number of testcases.

Each testcases contains two lines.

First line contains three integers n( 1 <= n <= 5000), m(1 <= m <= n), k(0 <= k <= n-1).

Second line contains n integers ai(1 <= ai <= 10^9).

 

Output

For each testcases, print a single integer x.

Each output is ended by \n.

Sample Input  Download

Sample Output  Download

Tags




Discuss