This problem is a Mooshak version of a CSES problem with relaxed time limit (3s) so that Java solutions with the desired complexity can pass.


[PC004] Traffic Lights

There is a street of length x whose positions are numbered 0,1,,x. Initially there are no traffic lights, but n sets of traffic lights are added to the street one after another.

Your task is to calculate the length of the longest passage without traffic lights after each addition.

Input

The first input line contains two integers x and n: the length of the street and the number of sets of traffic lights.

Then, the next line contains n integers p1,p2,,pn​: the position of each set of traffic lights. Each position is distinct.

Output

Print the length of the longest passage without traffic lights after each addition.

Don't forget to print a new line in the end and in this problem all printed integers should have a space after it, including the last number in the output.

Constraints

Example Input Example Output
8 3
3 6 2
5 3 3 

Competitive Programming (CC3032) 2024/2025
DCC/FCUP - University of Porto