A - 連続する高得点区間 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MiB

配点 : 233

問題文

高橋君は学校のテスト結果を分析しています。

クラスには N 人の生徒がおり、出席番号 1, 2, \ldots, N が付けられています。出席番号 i の生徒のテストの点数は A_i 点です。

高橋君は、基準点 K 点以上の点数を取った生徒を「合格者」と呼ぶことにしました。合格者たちをグループに分け、グループごとに 1 回ずつ表彰式を開きます。

グループ分けは次のルールで行います。合格者の出席番号の集合を、出席番号が連続する区間(これ以上両端に合格者を含めて広げることができない、極大な連続区間)に分割し、それぞれの区間を 1 つのグループとします。この分割の仕方は一意に定まります。

例えば、N = 10 で合格者の出席番号が 2, 3, 4, 7, 9, 10 のとき、グループは \{2, 3, 4\}, \{7\}, \{9, 10\}3 つに分かれます。

グループの個数を求めてください。なお、合格者がいない場合はグループの個数は 0 です。

制約

  • 1 \leq N \leq 2 \times 10^5
  • 0 \leq K \leq 100
  • 0 \leq A_i \leq 100
  • 入力はすべて整数

入力

N K
A_1 A_2 \cdots A_N
  • 1 行目には、生徒の人数を表す整数 N と、合格の基準点を表す整数 K が、スペース区切りで与えられる。
  • 2 行目には、各生徒のテストの点数を表す N 個の整数 A_1, A_2, \ldots, A_N が、スペース区切りで与えられる。

出力

グループの個数を 1 行で出力せよ。


入力例 1

5 60
72 45 80 85 50

出力例 1

2

入力例 2

10 70
65 75 80 90 60 55 85 70 72 40

出力例 2

2

入力例 3

15 50
48 52 55 60 45 30 70 80 75 65 40 90 35 85 88

出力例 3

4

Score : 233 pts

Problem Statement

Takahashi is analyzing the test results at his school.

There are N students in the class, assigned attendance numbers 1, 2, \ldots, N. The test score of the student with attendance number i is A_i points.

Takahashi decided to call students who scored at least K points (the passing threshold) "passers." The passers are divided into groups, and one award ceremony is held for each group.

The grouping is done according to the following rule. The set of attendance numbers of passers is partitioned into intervals of consecutive attendance numbers (maximal consecutive intervals that cannot be extended further by including additional passers at either end), and each interval forms one group. This partition is uniquely determined.

For example, when N = 10 and the attendance numbers of the passers are 2, 3, 4, 7, 9, 10, the groups are \{2, 3, 4\}, \{7\}, \{9, 10\}, resulting in 3 groups.

Find the number of groups. If there are no passers, the number of groups is 0.

Constraints

  • 1 \leq N \leq 2 \times 10^5
  • 0 \leq K \leq 100
  • 0 \leq A_i \leq 100
  • All inputs are integers

Input

N K
A_1 A_2 \cdots A_N
  • The first line contains an integer N representing the number of students and an integer K representing the passing threshold, separated by a space.
  • The second line contains N integers A_1, A_2, \ldots, A_N representing each student's test score, separated by spaces.

Output

Print the number of groups in one line.


Sample Input 1

5 60
72 45 80 85 50

Sample Output 1

2

Sample Input 2

10 70
65 75 80 90 60 55 85 70 72 40

Sample Output 2

2

Sample Input 3

15 50
48 52 55 60 45 30 70 80 75 65 40 90 35 85 88

Sample Output 3

4