#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <vector>
using namespace std;

#define WINDOW 60
#define SKEW 200

int main() {
  ios_base::sync_with_stdio(false);
  int N, K;
  while (cin >> N >> K) {
    K = min(K, N);
    vector<int> P(N), D(N);
    for (int i = 0; i < N; i++) cin >> P[i] >> D[i];

    vector<double> powHalf{1.0};
    for (int i = 0; i < 2*WINDOW; i++) powHalf.push_back(powHalf.back() / 2);
    vector<vector<double>> pv(WINDOW, vector<double>(N));
    for (int i = 0; i < N; i++)
    for (int j = 0; j < WINDOW; j++) {
      for (int k = max(0, i-WINDOW); k < i+WINDOW && k < N; k++) {
        if (D[k] >= D[i]-j/2) pv[j][i] += P[k]*(powHalf[min(2*WINDOW, abs(D[i]-D[k]))] -
                                                powHalf[min(2*WINDOW, abs(D[i]-j-D[k]))]);
      }
    }

    vector<int> expect(N);
    vector<pair<double, int>> greedy;
    for (int i = 0; i < N; i++) greedy.emplace_back(-pv[WINDOW-1][i], i);
    sort(greedy.begin(), greedy.end());
    for (int i = 0; i < K; i++) expect[greedy[i].second] = 1;
    for (int i = 1; i < N; i++) expect[i] += expect[i-1];

    vector<vector<double>> dyn(WINDOW, vector<double>(K+2));
    vector<double> next(K+2);
    for (int i = 0; i < N; i++) {
      int mink = expect[i] - SKEW, maxk = expect[i] + SKEW;
      mink = max({mink, 0, K-(N-i)});
      maxk = min({maxk, i, K});
      for (int k = mink; k <= maxk; k++) next[k+1] = 0.0;
      for (int j = WINDOW-1; j >= 0; j--) {
        int d = min(WINDOW-1, j + D[i] - (i ? D[i-1] : -1000000));
        for (int k = mink; k <= maxk; k++) {
          next[k+1] = max(next[k+1], dyn[j][k] + pv[d][i]);
          if (j < WINDOW-1) {
            dyn[d][k] = max(dyn[d][k], dyn[j][k]);
            dyn[j][k] = 0;
          }
        }
      }
      dyn[0].swap(next);
    }

    double ret = 0.0;
    for (int j = 0; j < WINDOW; j++) ret = max(ret, dyn[j][min(N, K)]);
    cout << fixed << setprecision(6) << ret << endl;
  }
}
