PEG Test '11 - Cyclopian Suits

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Author:
Problem type
PEG 11/12 Programming Test 1 - October 19

After securing a steady supply of oxygen, FurWear is ready to begin production of their fine apparel. Unfortunately, since the Oelfinn are giants, it takes a long time to make clothing for them, so FurWear can only make one size of clothing. They have acquired the Cyclopian census data and would like to find the most common size. Can you help them?

Input Specification

The first line consists of a single integer N (1 \le N \le 50\,000). The following N lines each contain a single integer a_i (10 \le a_i \le 1\,000), the size of clothing worn by the ith Oelfinn.

Output Specification

Output the number of most common sizes, followed by the most common sizes in ascending order, each on a separate line.

Sample Input

5
30
34
30
20
34

Sample Output

2
30
34

Comments

There are no comments at the moment.