#include<bits/stdc++.h>
using namespace std;
int n,k;
struct node
{
double m;
int s,b;
}a[100001];
inline const void read(int &x)
{
x=0;
char c=getchar();
while(c<'0'||c>'9') c=getchar();
while(c>='0'&&c<='9')
{
x=(x<<1)+(x<<3)+c-'0';
c=getchar();
}
}
bool com(node aa,node bb)
{
return aa.m>bb.m;
}
int main()
{
read(n);read(k);
for(int i=1;i<=n;i++)
read(a[i].s);
for(int i=1;i<=n;i++)
read(a[i].b);
for(int i=1;i<=n;i++)
a[i].m=(double)a[i].s/a[i].b;
sort(a+1,a+1+n,com);
if(k==1)
printf("%.2f\n",a[1].m);
//if(k==n)
//printf(".2f\n",a[n].m);
return 0;
}