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

Задача 39072. Number of pairs - 05


Задача

Темы: ЕГЭ
The file contains a sequence of integers. Sequence elements can take integer values ​​from -10 000 to 10 000 inclusive. Determine the number of pairs of the sequence in which both numbers end in F in the hexadecimal number system, and the sum of the elements of the pair has the same sign as the sum of all elements divisible by 16. In your answer, write down the  number of found pairs, then the maximum from the sums of the elements of such pairs (two numbers separated by a space in one line). In this problem, a pair means two successive elements of a sequence.

Assignment file