atcoder#ABC272E. [ABC272E] Add and Mex
[ABC272E] Add and Mex
Score : points
Problem Statement
You are given an integer sequence of length .
Perform the following operation times:
- For each , add to . Then, find the minimum non-negative integer not contained in .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print lines.
The -th line should contain the minimum non-negative integer not contained in after the -th operation.
3 3
-1 -1 -6
2
2
0
The -st operation makes the sequence
The minimum non-negative integer not contained in is .
The -nd operation makes the sequence
The minimum non-negative integer not contained in is .
The -rd operation makes the sequence
The minimum non-negative integer not contained in is .
5 6
-2 -2 -5 -7 -15
1
3
2
0
0
0