First pair with frequency sum over limit

Given a sequence of integers we are interested in frequencies of the
sums of consecutive number pairs. For instance, the sums of consecutive
number pairs of the input sequence 5, 7, 6, 5, 8, 4, 5 are
12, 13, 11, 13, 12, 9. Note that pair sums 12 and 13 have frecuency two,
and the first pair in the sequence achieving a frecuency sum greater
than one is 5, 8. Write a program that given a limit k and a sequence of
integers computes the first pair of consecutive numbers achieving a
frequency sum greater than k. For instance, provided that k is one and
given the previous input sequence the first pair achieving a frequency
sum greater than k is 5, 8.

Input

Input consists of a nonnegative integer k followed by a sequence of two
or more integers.

Output

The first pair of consecutive numbers in the input sequence achieving
frequency sum greater than k. If there is no such a pair, the message
not found must be printed.

Problem information

Author: ProAl

Generation: 2026-01-25T17:03:39.533Z

© Jutge.org, 2006–2026.
https://jutge.org
