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

using namespace std;

const int THRESH = 100;

int n, k;
int amt[30005];
int xloc[30005];
vector<pair<int, double>> edges[30005];

double dp[30005];
int used[30005];
int check(double penalty) {
  for(int i = 1; i <= n; i++) dp[i] = -1e100;
  dp[0] = 0;
  used[0] = 0;
  for(int i = 0; i < n; i++) {
    if(dp[i] > dp[i+1]) {
      dp[i+1] = dp[i];
      used[i+1] = used[i];
    }
    for(auto out: edges[i]) {
      if(dp[out.first] < dp[i] + out.second - penalty) {
        dp[out.first] = dp[i] + out.second - penalty;
        used[out.first] = used[i] + 1;
      }
    }
  }
  return used[n];
}

int main() {
  cin >> n >> k;
  for(int i = 0; i < n; i++) cin >> amt[i] >> xloc[i];
  for(int i = 0; i < n; i++) {
    for(int j = i; j < n && j-i < THRESH; j++) {
      double best = 0;
      for(int a = i; a <= j; a++) {
        double cand = 0;
        for(int b = i; b <= j; b++) {
          cand += amt[b] * pow(2, -abs(xloc[a] - xloc[b]));
        }
        best = max(best, cand);
      }
      edges[i].emplace_back(j+1, best);
    }
  }
  double lhsd = 0.0, rhsd = 300;
  double force = -1;
  for(int qq = 0; qq < 30; qq++) {
    double mid = (lhsd + rhsd) / 2;
    int usedamt = check(mid);
    if(usedamt == k) {
      force = mid;
      break;
    }
    if(usedamt < k) rhsd = mid;
    else lhsd = mid;
  }
  if(force < 0) force = (lhsd + rhsd) / 2;
  check(force);
  cout << fixed << setprecision(12) << dp[n] + k * force << "\n";
}