#arc075c. [arc075_c]Meaningful Mean

[arc075_c]Meaningful Mean

Problem Statement

You are given an integer sequence of length NN, a=a = {a1,a2,,aNa_1, a_2, …, a_N}, and an integer KK.

aa has N(N+1)/2N(N+1)/2 non-empty contiguous subsequences, {al,al+1,,ara_l, a_{l+1}, …, a_r} (1lrN)(1 ≤ l ≤ r ≤ N). Among them, how many have an arithmetic mean that is greater than or equal to KK?

Constraints

  • All input values are integers.
  • 1N2times1051 ≤ N ≤ 2 \\times 10^5
  • 1K1091 ≤ K ≤ 10^9
  • 1ai1091 ≤ a_i ≤ 10^9

Input

Input is given from Standard Input in the following format:

NN KK a1a_1 a2a_2 :: aNa_N

Output

Print the number of the non-empty contiguous subsequences with an arithmetic mean that is greater than or equal to KK.


Sample Input 1

3 6
7
5
7

Sample Output 1

5

All the non-empty contiguous subsequences of aa are listed below:

  • {a1a_1} = {77}
  • {a1,a2a_1, a_2} = {7,57, 5}
  • {a1,a2,a3a_1, a_2, a_3} = {7,5,77, 5, 7}
  • {a2a_2} = {55}
  • {a2,a3a_2, a_3} = {5,75, 7}
  • {a3a_3} = {77}

Their means are 77, 66, 19/319/3, 55, 66 and 77, respectively, and five among them are 66 or greater. Note that {a1a_1} and {a3a_3} are indistinguishable by the values of their elements, but we count them individually.


Sample Input 2

1 2
1

Sample Output 2

0

Sample Input 3

7 26
10
20
30
40
30
20
10

Sample Output 3

13