#K7826. Sort and Filter Integers

    ID: 35047 Type: Default 1000ms 256MiB

Sort and Filter Integers

Sort and Filter Integers

You are given two inputs: an integer threshold and a list of integers. Your task is to sort the list in ascending order and then filter out all numbers that are strictly less than the threshold. In mathematical terms, given a threshold \( T \) and a list \( A = [a_1, a_2, \dots, a_n] \), you need to output a sorted list \( B = [b_1, b_2, \dots, b_m] \) such that \( b_i \ge T \) for all \( i \) and \( B \) is in ascending order.

If the provided input is invalid (for example, if the threshold or any element of the list cannot be converted to an integer), output Invalid input.

Note: The program should read from stdin and write the result to stdout.

inputFormat

The first line contains the threshold \( T \) (an integer). The second line contains a sequence of space-separated values representing the list of integers. If the second line is empty, the list should be considered empty.

Examples of valid input:

4
5 3 8 1 4

outputFormat

If the input is valid, output the sorted list of integers (in Python list format, e.g. [4, 5, 8]). If no number meets the threshold, output an empty list: []. For any invalid input, output exactly Invalid input.

## sample
4
5 3 8 1 4
[4, 5, 8]