Skip to content
C

Elements Appearing More Than N/K Times

Mediumjavapythonccppjavascript

Given an array of N elements and an integer K, find every value that occurs more than N / K times (integer division).

Input Format

The first line contains two integers N and K. The second line contains N space-separated integers.

Output Format

Print the qualifying values in increasing order, separated by single spaces. If there are none, print an empty line.

Input (stdin)

Output

Run your code to see output here...