You are given array a1,a2,…,ana1,a2,…,an. Find the subsegment al,al+1,…,aral,al+1,…,ar (1≤l≤r≤n1≤l≤r≤n) with maximum arithmetic mean 1r−l+1∑i=lrai1r−l+1∑i=lrai(in floating-point numbers, i.e. without any rounding).
If there are many such subsegments find the longest one.
Input
The first line contains single integer nn (1≤n≤1051≤n≤105) — length of the array aa.
The second line contains nn integers a1,a2,…,ana1,a2,…,an (0≤ai≤1090≤ai≤109) — the array aa.
Output
Print the single integer — the length of the longest subsegment with maximum possible arithmetic mean.
Example
input
Copy
5
6 1 6 6 0
output
Copy
2
The subsegment [3,4][3,4] is the longest among all subsegments with maximum arithmetic mean.
There are nn emotes in very popular digital collectible card game (the game is pretty famous so we won‘t say its name). The ii-th emote increases the opponent‘s happiness by aiai units (we all know that emotes in this game are used to make opponents happy).
You have time to use some emotes only mm times. You are allowed to use any emotion once, more than once, or not use it at all. The only restriction is that you cannot use the same emote more than kk times in a row (otherwise the opponent will think that you‘re trolling him).
Note that two emotes ii and jj (i≠ji≠j) such that ai=ajai=aj are considered different.
You have to make your opponent as happy as possible. Find the maximum possible opponent‘s happiness.
Input
The first line of the input contains three integers n,mn,m and kk (2≤n≤2⋅1052≤n≤2⋅105, 1≤k≤m≤2⋅1091≤k≤m≤2⋅109) — the number of emotes, the number of times you can use emotes and the maximum number of times you may use the same emote in a row.
The second line of the input contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤1091≤ai≤109), where aiai is value of the happiness of the ii-th emote.
Output
Print one integer — the maximum opponent‘s happiness if you use emotes in a way satisfying the problem statement.
Examples
input
Copy
6 9 2
1 3 3 7 4 2
output
Copy
54
input
Copy
3 1000000000 1
1000000000 987654321 1000000000
output
Copy
1000000000000000000
In the first example you may use emotes in the following sequence: 4,4,5,4,4,5,4,4,54,4,5,4,4,5,4,4,5.
You a captain of a ship. Initially you are standing in a point (x1,y1)(x1,y1) (obviously, all positions in the sea can be described by cartesian plane) and you want to travel to a point (x2,y2)(x2,y2).
You know the weather forecast — the string ss of length nn, consisting only of letters U, D, L and R. The letter corresponds to a direction of wind. Moreover, the forecast is periodic, e.g. the first day wind blows to the side s1s1, the second day — s2s2, the nn-th day — snsn and (n+1)(n+1)-th day — s1s1 again and so on.
Ship coordinates change the following way:
if wind blows the direction U, then the ship moves from (x,y)(x,y) to (x,y+1)(x,y+1);
if wind blows the direction D, then the ship moves from (x,y)(x,y) to (x,y−1)(x,y−1);
if wind blows the direction L, then the ship moves from (x,y)(x,y) to (x−1,y)(x−1,y);
if wind blows the direction R, then the ship moves from (x,y)(x,y) to (x+1,y)(x+1,y).
The ship can also either go one of the four directions or stay in place each day. If it goes then it‘s exactly 1 unit of distance. Transpositions of the ship and the wind add up. If the ship stays in place, then only the direction of wind counts. For example, if wind blows the direction Uand the ship moves the direction L, then from point (x,y)(x,y) it will move to the point (x−1,y+1)(x−1,y+1), and if it goes the direction U, then it will move to the point (x,y+2)(x,y+2).
You task is to determine the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2).
Input
The first line contains two integers x1,y1x1,y1 (0≤x1,y1≤1090≤x1,y1≤109) — the initial coordinates of the ship.
The second line contains two integers x2,y2x2,y2 (0≤x2,y2≤1090≤x2,y2≤109) — the coordinates of the destination point.
It is guaranteed that the initial coordinates and destination point coordinates are different.
The third line contains a single integer nn (1≤n≤1051≤n≤105) — the length of the string ss.
The fourth line contains the string ss itself, consisting only of letters U, D, L and R.
Output
The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2).