#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define Max int(1e5+10)
int n,k;
const double eps=1e-6;
double mid;
int dcmp(double x)
{
if(fabs(x)<eps) return 0;
else return x<0?-1:1;
}
struct item
{
double s,c;
bool operator <(item x)
{
return dcmp(s*(c-mid)-x.s*(x.c-mid))>0;
}
}p[Max];
bool ok(double x)
{
mid=x;
double cnt=0,sum=0;
sort(p+1,p+1+n);
for(int i=1;i<=n;i++)
{
sum+=p[i].s*(p[i].c-mid);
if(i>=n-k)
{
cnt=max(cnt,sum);
if(dcmp(cnt)>0)
return 1;
}
}
return 0;
}
int main() {
while(~scanf("%d%d",&n,&k))
{
for(int i=1;i<=n;i++)
scanf("%lf",&p[i].s);
for(int i=1;i<=n;i++)
scanf("%lf",&p[i].c);
double l=0,r=1e7;
for(int i=0;i<50;i++)
{
mid=(l+r)/2;
if(ok(mid))
l=mid;
else
r=mid;
}
printf("%.11f\n",mid);
}
return 0;
}