- Time limit: 1.00 s
- Memory limit: 512 MB
The mex value of an array is the smallest nonnegative integer that doesn't appear in the array. For example, the mex value of the array is .
Given an array of size , your task is to calculate the mex value of each subarray of size .
Input
The first input line contains numbers and : the size of the array and the size of the subarray.
The next line contains numbers : the contents of the array.
Output
You should output numbers: the mex value of each subarray, in order from left to right.
Example
Input:
5 3 2 1 5 0 5
Output:
0 2 1
Explanation: The subarrays are , and .