Pagini recente » Cod sursa (job #897090) | Cod sursa (job #888511) | Cod sursa (job #1356917) | Cod sursa (job #1607753) | Cod sursa (job #64584)
Cod sursa(job #64584)
var a:array[1..500000]of integer;
max,min,x:integer;
n,i,j,k,p,u:longint;
begin
assign(input,'secventa.in');
reset(input);
assign(output,'secventa.out');
rewrite(output);
readln(n,k);
max:=-31000;
for i:=1 to n do
begin
read(a[i]);
min:=k;
x:=31000;
if i<min then min:=i;
for j:=i-min+1 to i do
begin
if a[j]<x then
begin
x:=a[j];
end;
end;
if x>max then
begin
max:=x;
p:=i-min+1;
u:=i;
end;
end;
writeln(p,' ',u,' ',max);
close(output);
end.