Олимпиадный тренинг

Задача 39075. Threes - 03


Задача

Темы: ЕГЭ
The file contains a sequence of integers. Sequence elements can take integer values ​​from -15000 to 15000 inclusive. Determine the number of triples in the sequence in which the second element is less than both of its neighbors, and at the same time the sum of the numbers in the triple has the opposite sign from the sum of all numbers. In your answer, write down the  number of triples found, then the minimum of the sums of the elements of such triples (two numbers separated by a space in one line) . In this task, under  a triple means three consecutive elements of a sequence.

Assignment file