Dishonest Lottery
InterviewTime limit1sMemory limit1024 MB
Given 10n drawings of five distinct numbers from 1 to 50, list every number that appears more than 2n times, or print -1 if none do.
- Level
Easy2 of 10
- Topics
- Array, Implementation
- Solved
- No attempts yet
Problem
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 of the time if the numbers are truly chosen randomly. If a number appears far more than that, it is suspicious.
Determine whether a set of lottery drawings is suspicious by listing all numbers that appear too often. To allow for random error, flag any number that appears more than of the time.
Input
The first line contains a single integer (). There will be lottery results to analyze.
Each of the next lines contains integers (). Each line represents one drawing. All values on a line are unique.
Output
On a single line, output all numbers that appear strictly more than times in the list. If there is more than one, output them separated by spaces, in sorted order from smallest to largest. If there are none, output .