Start 2024-04-06 07:00:00

six--20240406栈、队列(基础班)

End 2024-04-13 00:00:00
Contest is over.
Now 2025-11-17 14:34:20

H. 密钥

Description

有一种密钥是这样的:给出一个长度为n的序列A,输出A中所有长度为m的连续子序列的最大值即为密钥。例如n=7,有数组{8,7,1,5,9,3,6},当m=3,则密钥为87 999,其获取密钥过程如图3.5所示。

Input

第一行为两个整数,即n和m(1<n<90 000)。 第二行为n个整数。

Output

输出密钥值。

Examples

Input

7 3
8 7 1 5 9 3 6

Output

87999

Submit

Login

Signup
Time Limit 1 second
Memory Limit 128 MB
Submit