Panama Sum (panama)

24 teams scored 935 points on this task, for a maximum score of 100, an average score of 39 and a median score of 25.

Highlights

  1. Galileo Galilei, Trento is the institute with the most points (100).
  2. Lombardia is the region with the most points (260).

Statement

While their car was lost in Panama, Carlos and Pablo decided to have fun with some math. One day, Carlos came up with what he called a Panama sum. Basically, a Panama sum is the sum of some values in an 1-indexed array, where the values on the odd positions are added to the sum and the values on the even positions are subtracted from the sum. For example, the Panama sum of the array [10, 6, 9, 4, 2, 0] is 10 - 6 + 9 - 4 + 2 - 0 which is equal to 11. Because finding this is way too easy for Pablo (he is a programmer), he decided to make this challenge more difficult. Therefore, he invented the maximum Panama sum, which is defined as the maximum Panama sum we can get if we select a non-empty contiguous subarray from a given array. Now he wants Carlos to find this value for multiple queries which might involve changing some values as well. Help Carlos get this problem done and he will take you for a ride once he finds his car!