Pagini recente » Cod sursa (job #471923) | Cod sursa (job #2229608) | Cod sursa (job #2732423) | Cod sursa (job #2755978) | Cod sursa (job #1196801)
#include <cstdio>
#define DIM 1666013
#define Nmax 50005
#define INF 0x3f3f3f3f
using namespace std;
char buff[DIM];
int poz = DIM - 1;
int scan(int &A)
{
A = 0;
int sign = 1;
while(('0' > buff[poz] || buff[poz] > '9') && buff[poz] != '-')
if(++ poz == DIM)
fread(buff,1,DIM,stdin),poz = 0;
while(('0' <= buff[poz] && buff[poz] <= '9' ) || buff[poz] == '-')
{
if(buff[poz] == '-') sign *= -1;
else A = A * 10 + buff[poz] - 48;
if(++poz == DIM)
fread(buff,1,DIM,stdin),poz = 0;
}
A *= sign;
}
int C[Nmax],T[Nmax],I,S,N;
void read()
{
scan(N),scan(I),scan(S);
for(int i = 1; i <= N; ++i)
scan(C[i]);
for(int i = 1; i <= N; ++i)
scan(T[i]);
}
void solve()
{
double best = -999999999;
for(int i = 1; i <= N ; ++i)
for(int lung = I; lung <= S; ++lung)
{
int t = 0,c = 0;
for(int j = i; j <= i + lung - 1 && j <= N; ++j)
{
t += T[j];
c += C[j];
}
if( best < c/(t*1.0) )
best = c/(t*1.0);
}
printf("%.5lf\n",best);
}
int main()
{
freopen("secv3.in","r",stdin);
freopen("secv3.out","w",stdout);
read();
solve();
return 0;
}