Dishonest Lottery

시간 제한1초메모리 제한1024 MB

요약
5개 숫자로 이루어진 10n번의 추첨을 읽고, 2n번을 초과해 등장한 숫자를 오름차순으로 모두 출력한다.
난이도

쉬움10점 중 3점

유형
배열, 해시맵, 구현
정답자
아직 제출이 없습니다

문제

You suspect your local lottery of cheating! Some numbers are coming up too often!

Each week, the lottery randomly selects five numbers in the range from one to fifty. So, each number should appear about 1010\\% of the time if the numbers are truly chosen randomly. If a number appears far more than that, it’s suspicious!

Determine if a set of lottery drawings is suspicious by listing all numbers that appear too often. To allow for random error, you’ll need to flag any number that appears more than 2020\\% of the time.

입력

The first line of input contains a single integer nn (1≤n≤1,0001≤n≤1\\,000). There will be 10⋅n10 \cdot n lottery results for you to analyze.

Each of the next 10⋅n10 \cdot n lines contains 55 integers xx (1≤x≤501≤x≤50). Each line represents a drawing. All values on a line are unique.

출력

On a single line, output all numbers that appear strictly more than 2⋅n2 \cdot n times in the list. If there is more than one, output them space-separated, in sorted order from smallest to largest. If there aren’t any, output −1-1.

예제1

  1. 예제 1

    입력
    1
    32 30 16 45 27
    34 45 35 31 42
    1 12 26 50 13
    34 50 36 21 39
    47 7 41 18 45
    28 48 2 8 4
    16 40 17 2 19
    50 4 30 15 6
    31 13 33 46 18
    49 23 24 17 48
    
    예상 출력
    45 50