CF1199A.City Day

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

City Day

For years, the Day of city N was held in the most rainy day of summer. New mayor decided to break this tradition and select a not-so-rainy day for the celebration. The mayor knows the weather forecast for the nn days of summer. On the ii-th day, aia_i millimeters of rain will fall. All values aia_i are distinct.

The mayor knows that citizens will watch the weather xx days before the celebration and yy days after. Because of that, he says that a day dd is not-so-rainy if ada_d is smaller than rain amounts at each of xx days before day dd and and each of yy days after day dd. In other words, ad<aja_d \lt a_j should hold for all dxj<dd - x \le j \lt d and d<jd+yd \lt j \le d + y. Citizens only watch the weather during summer, so we only consider such jj that 1jn1 \le j \le n.

Help mayor find the earliest not-so-rainy day of summer.

Input

The first line contains three integers nn, xx and yy (1n1000001 \le n \le 100\,000, 0x,y70 \le x, y \le 7) — the number of days in summer, the number of days citizens watch the weather before the celebration and the number of days they do that after.

The second line contains nn distinct integers a1a_1, a2a_2, ..., ana_n (1ai1091 \le a_i \le 10^9), where aia_i denotes the rain amount on the ii-th day.

Output

Print a single integer — the index of the earliest not-so-rainy day of summer. We can show that the answer always exists.

Note

In the first example days 33 and 88 are not-so-rainy. The 33-rd day is earlier.

In the second example day 33 is not not-so-rainy, because 3+y=63 + y = 6 and a3>a6a_3 \gt a_6. Thus, day 88 is the answer. Note that 8+y=118 + y = 11, but we don't consider day 1111, because it is not summer.

Samples

10 2 2
10 9 6 7 8 3 2 1 4 5
3
10 2 3
10 9 6 7 8 3 2 1 4 5
8
5 5 5
100000 10000 1000 100 10
5

在线编程 IDE

建议全屏模式获得最佳体验