Large Small Sum

2.5

2 votes
Problem

Sidddharth is very kind-hearted. He doesn't want to give you any stupid problem statement that wastes your time.

Given an array of integers, find the sum of the ith largest and jth smallest number from the array.

Input Format:
First line of the input consists of a single integer T, number of test cases.
Each test case has 3 lines as input.
First line will have a single integer N, denoting number of elements in array(A).
Next line contains N integers.
Last line consists of integers i & j.

Output Format:
Print the required sum or for each test case

Constraints:
1 ≤ T <= 10
1 ≤ N <= 1000
1 ≤ A[i] <= 10^6
1 ≤ i,j <= n

Problem Setter : Siddharth Seth

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?