Type: Default 1000ms 256MiB

圆环取数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

有长度为n的一圈整数,要在n个数中找m个连续整数数和最大和最小。现要求输出最大连续m个数的起始数的和下标和最小连续m个数的起始数的和下标。

Input Format

第一行 n和m 第二行 n个数

Output Format

最大连续和的第一个数的下标 最小连续和的第一个数的下标

Sample

input

6 3  (n和m)
2 3 5 7 9 11  (n个数,但是6和1也是连着)

output

4  (最大3个数的和是7+9+11,7的下标是4)
1  (最小3个数的和是2+3+5,2的下标是1)


Hint

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}

20200810数组基本练习

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
12
Start at
2020-8-10 9:48
End at
2020-8-11 9:48
Duration
24 hour(s)
Host
Partic.
43