Pagini recente » Cod sursa (job #2946252) | Cod sursa (job #1265501) | Cod sursa (job #1906625) | Cod sursa (job #2784164) | Cod sursa (job #338500)
Cod sursa(job #338500)
var n,l,u,j,i:longint;max,s1,s2,s:real;
v,f:array[1..50000]of integer;
begin
assign(input,'secv3.in');reset(input);
assign(output,'secv3.out');rewrite(output);
readln(n,l,u);max:=-30000;
for i:=1 to n do read(v[i]);readln;
for i:=1 to n do read(f[i]);
for j:=1 to n-1 do begin
s1:=0;s2:=0;
for i:=j+1 to n do begin
s1:=s1+v[i];s2:=s2+f[i];
s:=s1/s2;
if (i-j+1>=l)and(i-j+1<=u) then
if s>max then max:=s;
end;
end;
writeln(max:0:2);
close(input);close(output);
end.