#K89307. Elements Occurring More Than N Times

    ID: 37501 Type: Default 1000ms 256MiB

Elements Occurring More Than N Times

Elements Occurring More Than N Times

Given a list of integers and an integer (n), your task is to output all distinct numbers from the list that appear more than (n) times. The output must be sorted in ascending order.

In other words, for a given array (A), return all (x) such that the frequency of (x), denoted as (\mathrm{freq}(x)), satisfies (\mathrm{freq}(x) > n).

inputFormat

The first line contains two integers (m) and (n) separated by a space, where (m) is the number of elements in the list and (n) is the frequency threshold. The second line contains (m) integers separated by spaces.

outputFormat

Output the numbers that appear more than (n) times, sorted in ascending order, separated by spaces. If no such numbers exist, output an empty line.## sample

7 1
3 1 2 2 4 3 3
2 3