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.
There is a street of length
Your task is to calculate the length of the longest passage without traffic lights after each addition.
The first input line contains two integers
Then, the next line contains
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.
Example Input | Example Output |
8 3 3 6 2 |
5 3 3 |