RETO1 - COMPUTADOR LOCO . . .
ZS Coder performs encoding in a crazy team. If a word is entered into the system in an amount c of consecutive seconds, everything disappears wrote.
More formally, if you have written a word in the second A and then the next word in the second B, then if (B-A) ≤ c, the new word is added to the other words on the screen. If (B-A)> c, then everything on the screen is cleared (after the last word you typed appears on the screen).
For example, if c = 5 and written in the second words 1, 3, 8, 14, 19, 20, after the second 8 3 words will be displayed. After that, everything disappears in the second 13 because nothing has been written before the 5 seconds. In the second 14 and 19 two words are written, and finally, in the second 20, you write a word, and a total of 3 words remain on the screen.
Yes give the times when the ZS Coder typed words. Determine how many words remain in after having finished writing all the screen.
The first line contains two integers N and C (1 ≤ n ≤ 100000, 1 ≤ c ≤ 109) - the number of words typed ZS Coder and delayed crazy, respectively equipment.
Print a single positive integer, the number of words that remain on the screen after all N words are written, in other words, in the second tn ..
1 3 8 14 19 20
1 3 5 7 9 10
The first example is explained in the problem. For the second example after writing the first word in the second one, it disappears because the next word is written in the second 3 and (3-1)> 1 Similarly to 5, 7 and 9, only one word remains in the second 9.
Then, a word is written in the second 10, it remains on the screen because (10-9) ≤ 1
acho que este problema esta errado, sem solução
luiz henrique avilla vigiato :
I need more examples