Pagini recente » Cod sursa (job #1752950) | Cod sursa (job #2775643) | Cod sursa (job #1520689) | Cod sursa (job #2040149) | Cod sursa (job #131340)
Cod sursa(job #131340)
var a,b:array[0..30010]of longint;
n,x,y,i,j:longint;
max:real;
begin
assign(input,'secv3.in');
reset(input);
assign(output,'secv3.out');
rewrite(output);
readln(n,x,y);
for i:=1 to n do
begin
read(a[i]);
a[i]:=a[i-1]+a[i];
end;
for i:=1 to n do
begin
read(b[i]);
b[i]:=b[i-1]+b[i];
end;
max:=0;
for i:=1 to n do
begin
for j:=i-x downto i-y do
begin
if j<0 then break;
if max<(a[i]-a[j])/(b[i]-b[j]) then max:=(a[i]-a[j])/(b[i]-b[j]);
end;
end;
writeln(max:0:2);
close(output);
end.