#C138. Modify List of Integers

    ID: 43377 Type: Default 1000ms 256MiB

Modify List of Integers

Modify List of Integers

Given a list of integers and a special integer \( k \), perform the following operations:

  1. Increment every occurrence of \( k \) in the list by 1.
  2. Remove all negative integers from the list.
  3. Remove duplicate integers while preserving the order of their first occurrence.
  4. Return the modified list sorted in ascending order.

Input will be provided via standard input and the result should be printed to standard output. The integers in the list and the integer \( k \) are given on separate lines. In the first line, the integers are separated by spaces. In the second line, the integer \( k \) is provided.

For example, for the input:

3 5 -2 3 7 5 -8 3 5
3

After increasing every occurrence of 3 by 1, removing negatives and duplicates, and then sorting the result, the output should be:

4 5 7

inputFormat

The input consists of two lines:

  • The first line contains a list of integers separated by spaces. This list may be empty.
  • The second line contains a single integer \( k \).

Read input from standard input (stdin).

outputFormat

Output the modified list as space-separated integers in a single line to standard output (stdout). If the list is empty, output an empty line.

## sample
3 5 3
3
4 5

</p>