Question
Longest High-Performing Streak

A factory records the daily output of a machine over N days. The output on day i is A_i units.

A contiguous streak of days is considered high-performing if the average daily output over that streak is at least P / Q (a target ratio given as a fraction).

Find the length of the longest high-performing streak.

Input

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.

Output

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.

Example
Example 1:
Input
6

5 2 8 1 9 3
4 1
Output
6
Explanation
The 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 1
Output
1
Explanation
A 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 1
Output
5
Explanation
The 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.

Online