#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <utility>
#include <vector>

using namespace std;

int n, k;
vector<int> p, d;
map<pair<int, int>, double> w, c, l, r;

void preprocess() {
  // l[i][j] is the utility of cities i through j when placing a station at j.
  // r[i][j] is the utility of cities i through j when placing a station at i.
  l.clear();
  r.clear();
  for (int i = 1; i <= n; ++i) {
    l.insert(make_pair(make_pair(i, i), p[i]));
    r.insert(make_pair(make_pair(i, i), p[i]));
  }
  for (int diff = 1; diff <= 60; ++diff) {
    for (int i = 1; i <= n; ++i) {
      int j = i + diff;
      if (j > n) break;
      if (d[j] - d[i] > 60) continue;
      l.insert(make_pair(make_pair(i, j),
                         l.at(make_pair(i + 1, j)) +
                             (double)p[i] * pow(2.0, -fabs(d[j] - d[i]))));
      r.insert(make_pair(make_pair(i, j),
                         r.at(make_pair(i, j - 1)) +
                             (double)p[j] * pow(2.0, -fabs(d[j] - d[i]))));
    }
  }
  // w[i][j] is the maximum utility of cities i through j when placing one
  // station in between.
  // c[i][j] is the station with maximum w[i][j];
  w.clear();
  c.clear();
  for (int i = 1; i <= n; ++i) {
    w.insert(make_pair(make_pair(i, i), p[i]));
    c.insert(make_pair(make_pair(i, i), i));
  }
  for (int diff = 1; diff <= 60; ++diff) {
    for (int i = 1; i <= n; ++i) {
      int j = i + diff;
      if (j > n) break;
      if (d[j] - d[i] > 60) continue;
      double ans = 0.0;
      int ans_c;
      for (int s = c.at(make_pair(i, j - 1)); s <= c.at(make_pair(i + 1, j));
           ++s) {
        double val = l.at(make_pair(i, s)) + r.at(make_pair(s, j)) - p[s];
        if (val > ans) {
          ans = val;
          ans_c = s;
        }
      }
      w.insert(make_pair(make_pair(i, j), ans));
      c.insert(make_pair(make_pair(i, j), ans_c));
    }
  }
  // for (int i = 1; i <= n; ++i) {
  //   for (int j = i; j <= n && d[j] - d[i] <= 60; ++j) {
  //     int s = j;
  //     double ans = 0.0;
  //     while (s >= i && d[j] - d[s] <= 30) {
  //       double val = l.at(make_pair(i, s)) + r.at(make_pair(s, j)) - p[s];
  //       if (val > ans) ans = val;
  //       --s;
  //     }
  //     w.insert(make_pair(make_pair(i, j), ans));
  //   }
  // }
}

int main() {
  cin >> n >> k;
  // Adds a virtual node at location -1 with population 0.
  p.push_back(0);
  d.push_back(-1);
  for (int i = 1; i <= n; ++i) {
    int this_p, this_d;
    cin >> this_p >> this_d;
    p.push_back(this_p);
    d.push_back(this_d);
  }
  preprocess();
  // Dynamic programming: f[i][j] is the maximum utility by placing i stations
  // within the first j cities.
  vector<vector<double> > f(k + 1, vector<double>(n + 1, 0.0));
  for (int i = 1; i <= k; ++i) {
    for (int j = 1; j <= n; ++j) {
      f[i][j] = max(f[i][j - 1], f[i - 1][j]);
      int s = j;
      while (s > 0 && d[j] - d[s] <= 60) {
        f[i][j] = max(f[i][j], f[i - 1][s - 1] + w.at(make_pair(s, j)));
        --s;
      }
    }
  }
  cout << fixed << setprecision(3) << f[k][n] << endl;
  return 0;
}