P2369 EXCEEDED WARNING A

Description

There are some numbers, all non-negative integers less than $10^9$, with a total count of $n$. Please output the smallest $m$ numbers among them. Beware of overflow, and note that Memory Limit = 4000 KiB.

Input Format

The first line contains two non-negative integers separated by a space: $n, m$. The next $n$ lines contain the $n$ randomly generated numbers, guaranteed to fit in a 32-bit integer.

Output Format

Output $m$ lines: the $m$ numbers described above, in ascending order from smallest to largest.

Explanation/Hint

Constraints: $m < 10^5$, $n < 10^6$. Translated by ChatGPT 5