#P2804. 神秘数字

神秘数字

Description

Given nn numbers, help Xiao Ming count how many contiguous subarrays have an average greater than a given number MM, and output this count. Note: the number can be very large, so please output the result modulo 9208493192084931.

Input Format

Two lines.
The first line contains two numbers nn and MM.
The second line contains nn numbers.

Output Format

One line with a single number, which is the answer modulo 9208493192084931.

4 3
1 5 4 2
5
4 4
5 2 7 3
6

Hint

Sample explanation:

  1. For these 44 numbers, the valid solutions are {5},{4},{5,4},{1,5,4},{5,4,2}\{5\},\{4\},\{5,4\},\{1,5,4\},\{5,4,2\}, for a total of 55 groups.
  2. For these 44 numbers, the valid solutions are {5},{7},{2,7},{7,3},{5,2,7},{5,2,7,3}\{5\},\{7\},\{2,7\},\{7,3\},\{5,2,7\},\{5,2,7,3\}, for a total of 66 groups.

Constraints:

  • For 10%10\% of the testdata, 1<n101 < n \le 10.
  • For 30%30\% of the testdata, 1<n10001 < n \le 1000.
  • For 50%50\% of the testdata, 1<n300001 < n \le 30000.
  • For 100%100\% of the testdata, 1<n2000001 < n \le 200000, 1<M30001 < M \le 3000, and each number is a positive integer not greater than 50005000.

Translated by ChatGPT 5