Easy Going.(Very Easy)
Practice
3.8 (174 votes)
Easy
Problem
61% Success 29264 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Coders here is a simple task for you, you have given an array of size N and an integer M.
Your task is to calculate the difference between maximum sum and minimum sum of N-M elements of the given array.
Constraints:
1<=t<=10
1<=n<=1000
1<=a[i]<=1000
Input:
First line contains an integer T denoting the number of testcases.
First line of every testcase contains two integer N and M.
Next line contains N space separated integers denoting the elements of array
Output:
For every test case print your answer in new line
Submissions
Please login to view your submissions
Similar Problems
Points:10
16 votes
Tags:
SortingAlgorithmsBubble SortImplementationBasics of ImplementationBasics of Input/Output
Editorial
No editorial available for this problem.