LearnPy Hub
← Modules & the Standard Library problems
Hard

K Largest

Read integers and k, and print the k largest values in decreasing order using heapq.nlargest.

Input

A line of integers, then k.

Output

One line.

Sample 1

Input
5 1 9 3 7
2
Output
9 7

Sample 2

Input
4 4 4
2
Output
4 4
solution.py
Output appears here
K Largest · Python practice problem · LearnPy Hub