A factory records the daily output of a machine over
A contiguous streak of days is considered high-performing if the average daily output over that streak is at least
Find the length of the longest high-performing streak.
The first line contains a single integer KaTeX can only parse string typed expression — the number of days.
The second line contains KaTeX can only parse string typed expression integers KaTeX can only parse string typed expression — the daily output values.
The third line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the target average, expressed as the fraction KaTeX can only parse string typed expression.
Print a single integer — the length of the longest streak of days whose average output is at least KaTeX can only parse string typed expression.
Input
6
5 2 8 1 9 3
4 1Output6ExplanationThe average of all 6 days is KaTeX can only parse string typed expression, which is at least KaTeX can only parse string typed expression, so the entire array qualifies, giving length 6.
Example 2:
Input
1
1
1 1Output1ExplanationA single day with output exactly matching the target ratio counts as a valid streak of length 1.
Example 3:
Input
5
10 1 10 1 10
1 1Output5ExplanationThe average of all 5 days is KaTeX can only parse string typed expression, which is at least KaTeX can only parse string typed expression, so the whole array qualifies.