Skip to content
C

K Largest Elements

Easyjavapythonccppjavascript

Given an integer array and K, find the K largest values.

Input Format

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

Output Format

Print the K largest values in decreasing order, separated by single spaces.

Input (stdin)

Output

Run your code to see output here...