PROBLEM LINK: Contest
DIFFICULTY: Simple
PREREQUISITES: Adhoc, Math, Sorting, Basic I/O
PROBLEM:
The aim is to find maximum sum by getting maximum difference of any two elements of each array.
SETTER’S SOLUTION: Solution Link
APPROACH:
Initialize sum S=0.
Take every array as input and sort it.
Take absolute sum of largest and smallest of array which is first and last element of the array.
Add it to the sum S.