Problem B
Reiknirit
As a final project in the course Þróun Hugbúnaðar (e. Software Development) Þórður decided to write a program serving a very important purpose. His program is an implementation of the following pseudocode:
-
Takes a list of numbers as input.
-
Prints the list.
-
Removes all instances of the most common number in the list (in case of a draw, remove the largest number).
-
Repeat
and until the list is empty.
For example, if the program gets the list
Input
The first line of the input contains one positive integer
Output
The only line of the output should contain the number of
numbers that Þórður’s program will print if given the numbers
Sample Input 1 | Sample Output 1 |
---|---|
5 1 2 1 4 4 |
9 |