#include<bits/stdc++.h>
using ll = long long;
signed main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int n, k;
std::cin >> n >> k;
std::vector<std::pair<int, int>> data(n);
for (auto& [x, y] : data) std::cin >> x >> y;
std::sort(data.begin(), data.end(), [&](auto a, auto b) {
if (a.second == -1) return false;
if (b.second == -1) return true;
return a.second < b.second;
});
std::cout << std::fixed << std::setprecision(15);
std::vector dp(n + 2, std::vector<double>(n + 1, 1e18)); // dp[collaborators][votes]
dp[1][0] = 0;
for (auto& [x, y] : data) {
for (int i = n; i >= 1; --i) {
for (int j = n - 1; j >= 0; --j) {
dp[i][j + 1] = std::min(dp[i][j + 1], dp[i][j] + 1.0 * x / i);
if (y != -1) {
dp[i + 1][j + 1] = std::min(dp[i + 1][j + 1], dp[i][j] + 1.0 * y / i);
}
}
}
}
double ans = 1e18;
for (int i = 1; i <= n + 1; ++i) {
for (int j = 0; j <= n; ++j) {
if (j >= k) ans = std::min(ans, dp[i][j]);
}
}
std::cout << ans;
}