P25651 [AtCoder] Remove It
入门
题目描述

Problem Statement

Given are an integer sequence A of length N, and an integer X.
Remove all elements that are equal to X from A, and arrange the remaining elements without changing the order to obtain the sequence A'. Print A'.

Input

Input is given from Standard Input in the following format:
N X
$A_1 A_2 A_3 \dots A_N$

Output

Print the elements of A' in order, with space in between.

Constraints

  • $1 \le N \le 10^5$
  • $1 \le X \le 10^9$
  • $1 \le A_i \le 10^9$
  • All values in input are integers.

Sample Input 1

5 5
3 5 6 5 4

Sample Output 1

3 6 4

Removing 5s from [3, 5, 6, 5, 4] results in [3, 6, 4].

Sample Input 2

3 3
3 3 3

Sample Output 2

A' can be a sequence with zero elements, in which case we should just print an empty line.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 5 3 5 6 5 4
样例输出
3 6 4