#arc075c. [arc075_c]Meaningful Mean
[arc075_c]Meaningful Mean
Problem Statement
You are given an integer sequence of length , {}, and an integer .
has non-empty contiguous subsequences, {} . Among them, how many have an arithmetic mean that is greater than or equal to ?
Constraints
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of the non-empty contiguous subsequences with an arithmetic mean that is greater than or equal to .
Sample Input 1
3 6
7
5
7
Sample Output 1
5
All the non-empty contiguous subsequences of are listed below:
- {} = {}
- {} = {}
- {} = {}
- {} = {}
- {} = {}
- {} = {}
Their means are , , , , and , respectively, and five among them are or greater. Note that {} and {} 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