Frequent Opposite-Supported Numbers

Given a sequence of integers, we say that an integer n is
opposite-supported in the sequence if both n and −n appear in it. Write
a program that finds a frequent opposite-supported number in a sequence.

Input

Input starts with a non-negative integer k that indicates the desired
frequency. Then, a sequence of integers follows, possibly distributed
along several lines.

Output

Write the absolute value of the first integer in the sequence that is
found both to appear at least k times in it and to be opposite-supported
in it. Write "NONE" if no such integer is found.

Problem information

Author: José Luis Balcázar

Generation: 2026-01-25T19:42:13.187Z

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