Very Simple Problem
Time limit1sMemory limit128 MB
Find problems that more than half of the jury rated with its minimum score and that no jury member rated with its maximum score.
- Level
Easy3 of 10
- Topics
- Implementation, Array
- Solved
- No attempts yet
Problem
While preparing a programming contest, the jury faces many hard tasks. One of them is to choose a problem that is easy enough for most, if not all, contestants to solve.
The difficulty is that the word “simple” means different things to different jury members. So the jury reaches a consensus with the following procedure. Each member assigns every proposed problem an integer “complexity rating” (different problems may receive the same rating). A member calls the problems to which they gave the minimum rating “simplest”, and the problems to which they gave the maximum rating “hardest”.
The ratings from all jury members are then compared. A problem is declared “very simple” if it was called “simplest” by more than half of the jury and was called “hardest” by nobody.
Input
The first line contains the number of jury members and the number of problems (). Each of the next lines contains integers, each a complexity rating between and inclusive.
Output
Print the numbers of the “very simple” problems in increasing order, separated by spaces. Problems are numbered starting from . If there are no such problems, print a single integer .