Codeforces Round 372 (Div. 2)
A
Crazy Computer
Codeforces
800
原题
←B →
翻译中…

ZS the Coder is coding on a crazy computer. If you don't type in a word for a $*c*$ consecutive seconds, everything you typed disappear!

翻译中…

More formally, if you typed a word at second $*a*$ and then the next word at second $*b*$, then if $*b* - *a* ≤ *c*$, just the new word is appended to other words on the screen. If $*b* - *a* > *c*$, then everything on the screen disappears and after that the word you have typed appears on the screen.

翻译中…

For example, if $*c* = 5$ and you typed words at seconds $1, 3, 8, 14, 19, 20$ then at the second $8$ there will be $3$ words on the screen. After that, everything disappears at the second $13$ because nothing was typed. At the seconds $14$ and $19$ another two words are typed, and finally, at the second $20$, one more word is typed, and a total of $3$ words remain on the screen.

翻译中…

You're given the times when ZS the Coder typed the words. Determine how many words remain on the screen after he finished typing everything.

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*c*$ ($1 ≤ *n* ≤ 100 000, 1 ≤ *c* ≤ 10^{9}$) — the number of words ZS the Coder typed and the crazy computer delay respectively.

翻译中…

The next line contains $*n*$ integers $*t*_{1}, *t*_{2}, ..., *t*_{*n*}$ ($1 ≤ *t*_{1} < *t*_{2} < ... < *t*_{*n*} ≤ 10^{9}$), where $*t*_{*i*}$ denotes the second when ZS the Coder typed the $*i*$-th word.

翻译中…

Output

翻译中…

Print a single positive integer, the number of words that remain on the screen after all $*n*$ words was typed, in other words, at the second $*t*_{*n*}$.

翻译中…

Note

翻译中…

The first sample is already explained in the problem statement.

翻译中…

For the second sample, after typing the first word at the second $1$, it disappears because the next word is typed at the second $3$ and $3 - 1 > 1$. Similarly, only $1$ word will remain at the second $9$. Then, a word is typed at the second $10$, so there will be two words on the screen, as the old word won't disappear because $10 - 9 ≤ 1$.

翻译中…

样例

Input #1
6 5
1 3 8 14 19 20
Output #1
3
InputCopy OutputCopy
Input #2
6 1
1 3 5 7 9 10
Output #2
2
InputCopy OutputCopy
题目信息
题号
716A
时间限制
2 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。