Maximum Difference (maxdifference)

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.

Highlights

  1. Banfi, Vimercate is the institute with the most points (150).
  2. Lombardia is the region with the most points (680).

Statement

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!