#include<iostream> #include<stdio.h> #include<cstring> #include<algorithm> using namespace std; int N,K; struct date { double ai,bi; }node[1111]; double arr[1111]; bool DO( double mid ) { for( int i = 1; i <= N; i++ ) arr[i] = node[i].ai - mid*node[i].bi; sort( &arr[1],&arr[1]+N ); double ans = 0; for( int i = K + 1; i <= N; i++ ) ans += arr[i]; if( ans >= 0 )return true; return false; } int search( double lt,double rt ) { double res; while( rt - lt >= 0.00001 ) { double mid = ( lt+rt )/2.; if( DO( mid ) ){ res = mid; lt = mid; } else rt = mid; } return int((res+0.005)*100.); } int main( ) { while( scanf("%d%d",&N,&K) ) { if( N == 0 && K == 0 )break; for( int i = 1; i <= N; i++ ) scanf("%lf",&node[i].ai); for( int i = 1; i <= N; i++ ) scanf("%lf",&node[i].bi); printf("%d\n",search(0,1000)); } } /* 3 1 5 0 2 5 1 6 4 2 1 2 7 9 5 6 7 9 */