Maximum Points

0

0 votes
Easy
Problem

Given an array A consisting of N integers. In a single step player can choose an element of the array (let's denote it ak) and delete it, also all elements equal to ak + 1,ak + 2......ak+ R and ak- 1,ak - 2.....ak- L must be deleted from the array. This step will add ak points to player. Player can perform any number of steps.

Find maximum points which can be obtained.

Input:

First line contains T test cases.

Each test case contains three integers N, L and R, where N is number of elements in array, and use of L and R has been explained in Problem statement.

The next line contains N integers denoting elements of array A.

Output:

A single line for each test case, output a single integer denoting the maximum points possible..

Constraints:

1 <= T <= 100

1 <= N, L, R <= 10^5

1<= ak <=10^5

 

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

?