25 teams scored 935 points on this task, for a maximum score of 100, an average score of 37 and a median score of 15.
William is again playing his favorite game, RollerCoaster Typhoon. He just loves it when family-friendly fun and natural catastrophes mix together. In the game, there are some predefined tracks that can be selected by the player. A track is formed by N junctions, numbered from 1 to N, which are then automatically connected by roller coaster sections. The i-th junction is located at a specific height H_i. For example, suppose that H = {8, 3, 3, 7, 5, 9, 10, 8}. For such junction height values, the roller coaster would look something like this: William loves to scare as much as possible the tiny virtual people going on his roller coaster. He calls his favorite tracks The Crazy Tracks. We will say that a track is crazy if every consecutive triplet of junctions is alternating, that is: for every i such that 2 < i < N - 1, one of the following is true: (1) H_i-1 < H_i > H_i+1. (2) H_i-1 > H_i < H_i+1...