#include <bits/stdc++.h>
#include <iostream>
#define ll long long int
using namespace std;
const long long MOD = 1e9 + 7;
// void debug(vector<ll> &arr) {
// for (auto it: arr) {
// cout << it << " ";
// }
// cout << endl;
// cout << endl;
// }
// void debug(vector<ll> &arr, int n) {
// for (int i = 0; i < n; i++) {
// cout << arr[i] << " ";
// }
// cout << endl;
// cout << endl;
// }
ll lcm(ll a, ll b) {
return (a * b) / __gcd(a, b);
}
// ll get_msb(ll n) {
// for (int i = 31; i >= 0; i--) {
// if ((1 << i) & n) {
// return i + 1;
// }
// }
// return 1;
// }
bool is_possible(vector<ll> &arr, int n, ll t, ll time) {
ll total_products = 0;
for (auto it: arr) {
total_products += time / it;
}
return total_products >= t;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int t = 1;
// cin >> t;
while(t--) {
int n;
cin >> n;
ll k;
cin >> k;
vector<long double> arr(n, 0), brr(n, 0);
ll sum = 0;
for (int i = 0; i < n; i++) {
cin >> arr[i];
cin >> brr[i];
sum += arr[i];
}
ll lo = 0, hi = sum;
long double ans = 0;
long double precision = 1e-7;
ll itr = 0;
while (hi - lo >= precision) {
itr++;
if (itr == 100) break;
long double ratio = (lo + hi) / 2.0;
vector<long double> arr2(n, 0);
for (int i = 0; i < n; i++) {
arr2[i] = arr[i] - ratio * brr[i];
}
sort(arr2.begin(), arr2.end());
ll sum2 = 0;
ll count = 0;
for (int i = n - 1; i >= 0; i--) {
if (count == k) break;
sum2 += arr2[i];
count++;
}
if (sum2 < 0) {
hi = ratio - precision;
}
else {
lo = ratio + precision;
ans = max(ans, ratio);
}
}
cout << ans << endl;
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2RlZmluZSBsbCBsb25nIGxvbmcgaW50CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmNvbnN0IGxvbmcgbG9uZyBNT0QgPSAxZTkgKyA3OwoKLy8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sc3Rkb3V0KTsKICAgICNlbmRpZgogICAgCiAgICBpbnQgdCA9IDE7CiAgICAvLyBjaW4gPj4gdDsKICAgIHdoaWxlKHQtLSkgeyAgCiAgICAgIGludCBuOwogICAgICBjaW4gPj4gbjsKICAgICAgbGwgazsKICAgICAgY2luID4+IGs7CiAgICAgIHZlY3Rvcjxsb25nIGRvdWJsZT4gYXJyKG4sIDApLCBicnIobiwgMCk7CiAgICAgIGxsIHN1bSA9IDA7CiAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgY2luID4+IGFycltpXTsKICAgICAgICBjaW4gPj4gYnJyW2ldOwogICAgICAgIHN1bSArPSBhcnJbaV07CiAgICAgIH0KCiAgICAgIGxsIGxvID0gMCwgaGkgPSBzdW07CiAgICAgIGxvbmcgZG91YmxlIGFucyA9IDA7CiAgICAgIGxvbmcgZG91YmxlIHByZWNpc2lvbiA9IDFlLTc7CiAgICAgIAogICAgICBsbCBpdHIgPSAwOwogICAgICB3aGlsZSAoaGkgLSBsbyA+PSBwcmVjaXNpb24pIHsKICAgICAgICBpdHIrKzsKICAgICAgICBpZiAoaXRyID09IDEwMCkgYnJlYWs7CiAgICAgICAgbG9uZyBkb3VibGUgcmF0aW8gPSAobG8gKyBoaSkgLyAyLjA7CiAgICAgICAgdmVjdG9yPGxvbmcgZG91YmxlPiBhcnIyKG4sIDApOwogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgICBhcnIyW2ldID0gYXJyW2ldIC0gcmF0aW8gKiBicnJbaV07CiAgICAgICAgfQogICAgICAgIHNvcnQoYXJyMi5iZWdpbigpLCBhcnIyLmVuZCgpKTsKICAgICAgICBsbCBzdW0yID0gMDsKICAgICAgICBsbCBjb3VudCA9IDA7CiAgICAgICAgZm9yIChpbnQgaSA9IG4gLSAxOyBpID49IDA7IGktLSkgewogICAgICAgICAgICBpZiAoY291bnQgPT0gaykgYnJlYWs7CiAgICAgICAgICAgIHN1bTIgKz0gYXJyMltpXTsKICAgICAgICAgICAgY291bnQrKzsKICAgICAgICB9CiAgICAgICAgaWYgKHN1bTIgPCAwKSB7CiAgICAgICAgICAgIGhpID0gcmF0aW8gLSBwcmVjaXNpb247CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsbyA9IHJhdGlvICsgcHJlY2lzaW9uOwogICAgICAgICAgICBhbnMgPSBtYXgoYW5zLCByYXRpbyk7CiAgICAgICAgfQogICAgICB9CgogICAgICBjb3V0IDw8IGFucyA8PCBlbmRsOwogICB9Cn0K