#P2804. Count of Subarrays with Average Greater Than M

    ID: 16066 Type: Default 1000ms 256MiB

Count of Subarrays with Average Greater Than M

Count of Subarrays with Average Greater Than M

Given an array of (n) integers and a number (M), count the number of contiguous subarrays such that the average of the subarray is greater than (M). The average of a subarray ([a_i, a_{i+1}, \dots, a_j]) is defined as (\frac{a_i + a_{i+1} + \dots + a_j}{j-i+1}), and the condition can be rewritten in (\LaTeX) as

[ a_i + a_{i+1} + \dots + a_j > M \times (j-i+1), ]

given that the result can be very large, output the answer modulo (92084931).

inputFormat

The first line contains two integers (n) and (M). The second line contains (n) space-separated integers representing the array.

outputFormat

Output a single integer: the number of contiguous subarrays whose average is greater than (M), taken modulo (92084931).

sample

3 2
1 3 2
2