Pagini recente » Cod sursa (job #718358) | Cod sursa (job #562908) | Cod sursa (job #2782861) | Cod sursa (job #672141) | Cod sursa (job #64582)
Cod sursa(job #64582)
var a:array[1..500000]of integer;
n,i,j,p,u,max,k,min,x:integer;
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.