Pagini recente » Cod sursa (job #2914837) | Cod sursa (job #2338359) | Cod sursa (job #1184115) | Cod sursa (job #2722525) | Cod sursa (job #277883)
Cod sursa(job #277883)
var c,t:array[0..30000] of longint;
max,s:real;
i,j,n,l,u:integer;
begin
assign(input,'secv3.in'); reset(input);
assign(output,'secv3.out'); rewrite(output);
readln(n,l,u);
for i:=1 to n do read(c[i]);
readln;
for i:=1 to n do read(t[i]);
for i:=2 to n do
begin
c[i]:=c[i]+c[i-1];
t[i]:=t[i]+t[i-1];
end;
c[0]:=0;
t[0]:=0;
max:=0;
for i:=1 to n+1-l do
for j:=i+l-1 to i+u-1 do
begin
s:=(c[j]-c[i-1])/(t[j]-t[i-1]);
if s>max then max:=s;
end;
writeln(max:10:2);
close(input);
close(output);
end.