#C14789. Merge and Sort Odd Numbers

    ID: 44476 Type: Default 1000ms 256MiB

Merge and Sort Odd Numbers

Merge and Sort Odd Numbers

In this problem, you are given two lists of integers. Your task is to merge these two lists, filter out the even numbers, and then sort the remaining odd numbers in ascending order. A number is considered odd if it satisfies the condition nmod20n \mod 2 \neq 0. If there are no odd numbers, print an empty line. The input is provided via stdin and the output should be printed to stdout.

inputFormat

The input is provided via standard input (stdin) in the following format:

1. The first line contains an integer nn, representing the number of elements in the first list.
2. The second line contains nn space-separated integers, representing the first list.
3. The third line contains an integer mm, representing the number of elements in the second list.
4. The fourth line contains mm space-separated integers, representing the second list.

outputFormat

Output the odd numbers from the merged list in ascending order, separated by a space. If there are no odd numbers, output an empty line.## sample

3
10 3 5
3
6 7 1
1 3 5 7