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

using namespace std;

const int THRESH = 100;

typedef long double ld;

int n, k;
int amt[30005];
int xloc[30005];
ld lhsutil[30005][THRESH];
ld rhsutil[30005][THRESH];
vector<pair<int, ld>> edges[30005];

ld dp[30005];
ld ndp[30005];

int main() {
  cin >> n >> k;
  k = min(k, n);
  for(int i = 0; i < n; i++) cin >> amt[i] >> xloc[i];
  for(int i = 0; i < n; i++) {
    ld curr = 0;
    for(int j = 0; j < THRESH; j++) {
      if(i - j >= 0) curr += amt[i - j] * pow((ld)2., xloc[i - j] - xloc[i]);
      else curr = -1e100;
      lhsutil[i][j] = curr;
    }
  }
  for(int i = 0; i < n; i++) {
    ld curr = 0;
    for(int j = 0; j < THRESH; j++) {
      if(i + j < n) curr += amt[i + j] * pow((ld)2., xloc[i] - xloc[i + j]);
      else curr = -1e100;
      rhsutil[i][j] = curr;
    }
  }
  for(int i = 0; i < n; i++) {
    for(int j = i; j < n && j-i < THRESH; j++) {
      ld best = 0;
      for(int a = i; a <= j; a++) {
        ld cand = lhsutil[a][a-i];
        cand += rhsutil[a][j-a];
        cand -= amt[a];
        best = max(best, cand);
      }
      edges[i].emplace_back(j+1, best);
    }
  }
  for(int a = 1; a <= n; a++) {
    dp[a] = -1;
  }
  dp[0] = 0;
  while(k--) {
    fill(ndp, ndp+n+1, -1);
    for(int a = 0; a <= n; a++) {
      if(a) dp[a] = max(dp[a], dp[a-1]);
      if(dp[a] < 0) continue;
      for(auto out: edges[a]) {
        ndp[out.first] = max(ndp[out.first], dp[a] + out.second);
      }
    }
    memcpy(dp, ndp, sizeof(dp));
  }
  cout << fixed << setprecision(12) << *max_element(dp, dp+n+1) << "\n";
}