Pagini recente » Borderou de evaluare (job #1225275) | Cod sursa (job #684053) | Cod sursa (job #307967) | Cod sursa (job #356523) | Cod sursa (job #214042)
Cod sursa(job #214042)
program pascal;
var f,g:text;
n,i,k,x,pi,ps,max:longint;
begin
assign(f,'secventa.in'); reset(f);
assign(g,'secventa.out'); rewrite(g);
max:=-30001;
read(f,n,k);
for i:=1 to n do
begin
read(f,x);
if i<=n-k+1 then
if x>max then
begin
max:=x;
pi:=i;
ps:=i+k-1;
end;
end;
write(g,pi,' ',ps,' ',max);
close(f);
close(g);
end.