Dolls
문제
Marc is teaching some children about objects with different sizes. To demonstrate this concept, he will be using dolls. These dolls are hollow on the inside, so smaller dolls can be placed inside larger ones.
Each doll has a certain size. A doll of size can fit inside another doll of size if y - x ≥ 2. In other words, a smaller doll can fit in a larger doll if the difference in size between the larger doll and the smaller doll is at least .
A doll stack is formed by selecting some dolls that Marc has and repeatedly fitting the smallest doll into the second smallest doll until only one doll is left. The size of a doll stack is the number of dolls used to create it.
There are n days. On the th (1 ≤ i ≤ n) day, Marc will buy a doll of size . After buying the doll, he will try to construct a doll stack with the maximum number of dolls. Help Marc compute, for each day, the maximum size of a doll stack using the dolls available on that day.
입력
The first line of input contains exactly integer, .
The second line contain integers , representing the sizes of the dolls bought on each of the days.
출력
The output should contain integers on a single line and separated by spaces. The -th integer should be the maximum size of a doll stack using the dolls available on that day.
예제
예제 1
5 1 2 3 4 5
1 1 2 2 3
예제 2
5 2 4 6 8 10
1 2 3 4 5
예제 3
5 3 3 1 3 2
1 1 2 2 2