#P2804. 神秘数字
神秘数字
Description
Given numbers, help Xiao Ming count how many contiguous subarrays have an average greater than a given number , and output this count. Note: the number can be very large, so please output the result modulo .
Input Format
Two lines.
The first line contains two numbers and .
The second line contains numbers.
Output Format
One line with a single number, which is the answer modulo .
4 3
1 5 4 2
5
4 4
5 2 7 3
6
Hint
Sample explanation:
- For these numbers, the valid solutions are , for a total of groups.
- For these numbers, the valid solutions are , for a total of groups.
Constraints:
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , , and each number is a positive integer not greater than .
Translated by ChatGPT 5
京公网安备 11011102002149号