Pagini recente » Cod sursa (job #1336864) | Cod sursa (job #2275012) | Cod sursa (job #2446938) | Cod sursa (job #3258154) | Cod sursa (job #233971)
Cod sursa(job #233971)
var n,l,u,i,j,k:integer;
cst,timp:array[0..30000] of longint;
f:text; max:real;
begin
assign(f,'secv3.in');reset(f);
read(f,n,l,u); cst[0]:=0; timp[0]:=0;
for i:=1 to n do
begin
read(f,cst[i]);
cst[i]:=cst[i-1]+cst[i];
end;
for i:=1 to n do
begin
read(f,timp[i]);
timp[i]:=timp[i]+timp[i-1];
end;
close(f);
max:=0;
for k:=l to u do
for i:=k to n do
if ((cst[i]-cst[i-k])/(timp[i]-timp[i-k]))>max then
max:=(cst[i]-cst[i-k])/(timp[i]-timp[i-k]);
assign(f,'secv3.out');rewrite(f);
writeln(f,max:2:2);
close(f);
end.