atcoder#ARC075C. [ARC075E] Meaningful Mean
[ARC075E] Meaningful Mean
Score : points
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 .
3 6
7
5
7
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.
1 2
1
0
7 26
10
20
30
40
30
20
10
13