Pagini recente » Cod sursa (job #1788037) | Cod sursa (job #1437078) | Cod sursa (job #2579329) | Cod sursa (job #2417678) | Cod sursa (job #64583)
Cod sursa(job #64583)
var a:array[1..500000]of longint;
n,i,j,p,u,max,k,min,x: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.