60 teams scored 2490 points on this task, for a maximum score of 100, an average score of 42 and a median score of 30.
You are given an array A of N integers. Your goal is to split the array into one or more non-empty contiguous subarrays. The value of a subarray is defined as the difference between its maximum and minimum elements. Your task is to determine the best way to split the array to maximize the sum of these values. Write a program which computes these optimal sums!