Pagini recente » Cod sursa (job #650423) | Cod sursa (job #3000353) | Cod sursa (job #866309) | Borderou de evaluare (job #1251200) | 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.