Sorting with priority queues

Use priority queues to sort a sequence of integer numbers, in
nondecreasing order and also in nonincreasing order.

Input

Input consists of a sequence of integer numbers.

Output

Print two lines, the first one with the numbers in increasing order, and
the second one with the numbers in decreasing order.

Observation

To solve this exercise, the only containers that you should use are
priority queues of integer numbers.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:02:58.026Z

© Jutge.org, 2006–2026.
https://jutge.org
