import java.io.*;
import java.util.*;

/**
 * This solution uses dynamic programming together with an observation
 * about the require precision.
 * The optimal placements will always have stations placed on cities.
 * The basic idea is to keep track of the maximum utility from placing
 * i stations such that the last station is placed at city j (only 
 * counting populations to the left of city j). 
 * But computing this naively has complexity O(k*n*n) and this is too
 * slow. Our answer only needs to be accurate to with 10^-3. So we 
 * really don't care about accurately counting which station a city is
 * closest to if the distance is sufficiently large. So past a certain
 * distance of previous station, we can group all possible previous 
 * locations together. That is, we track the maximum utility possible
 * where i stations have been placed and the last station is placed at
 * a location index less than or equal to j (including cities up to a
 * fixed distance after the last station). 
 * This implementation has complexity O(k*n*log^2(n/EPS)), where EPS is
 * the required precision. It would be simple to modify this 
 * implementation to have complexity O(k*n*log(n/EPS)) by adding in 
 * some pre-computation, but the extra log(n/EPS) factor should fit 
 * within the time limit if the bounds don't change.
 *
 * @author Finn Lidbetter
 */

public class TrainLines {

  static long LOOKBACK_MAX = 30;
  
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] s = br.readLine().split(" ");
    int n = Integer.parseInt(s[0]);
    int k = Integer.parseInt(s[1]);
    long[] populations = new long[n];
    long[] distances = new long[n];
    distances[0] = -2*(LOOKBACK_MAX+1);
    for (int i=0; i<n; i++) {
      s = br.readLine().split(" ");
      long p = Long.parseLong(s[0]);
      long d = Long.parseLong(s[1]);
      populations[i] = p;
      distances[i] = d;
    }

    // dp[i][j] is the maximum definite utility after placing
    // i stations such that the last station is placed at city j.
    // Only cities with distance less than or equal to distances[j]
    // are included in this utility.
    double[][] dp = new double[k][n];

    // lookbackBest[i][j] is the maximum utility from placing 
    // i stations such that the last station was placed at city 
    // l<=j and all stations with distance between distances[l] 
    // and distances[l]+LOOKBACK_MAX are closest to station l.
    double[][] lookbackBest = new double[k][n];
    
    // Initialize the first row.
    for (int i=1; i<k; i++) {
      Arrays.fill(dp[i], Double.NEGATIVE_INFINITY);
      Arrays.fill(lookbackBest[i], Double.NEGATIVE_INFINITY);
    }
    for (int j=0; j<n; j++) {
      for (int l=0; l<=LOOKBACK_MAX; l++) {
        if (j-l<0 || distances[j]-distances[j-l]>LOOKBACK_MAX) {
          break;
        }
        dp[0][j] += populations[j-l]*Math.pow(2, distances[j-l]-distances[j]);
      }
      double sum = dp[0][j];
      for (int l=1; l<=LOOKBACK_MAX; l++) {
        if (j+l>=n || distances[j+l]-distances[j]>LOOKBACK_MAX) {
          break;
        }
        sum += populations[j+l]*Math.pow(2, distances[j]-distances[j+l]);
      }
      if (j==0) {
        lookbackBest[0][0] = sum;
      } else {
        lookbackBest[0][j] = Math.max(lookbackBest[0][j-1], sum);
      }
    }

    // Bottom up DP.
    for (int i=1; i<k; i++) {
      for (int j=i; j<n; j++) {
        // Try placing the ith station at location j.
        double best = 0;
        // For cities closer than LOOKBACK_MAX, consider each one as the possible
        // location of the previous station.
        int lookback = 1;
        while (lookback<=2*LOOKBACK_MAX) {
          if (lookback>j || distances[j]-distances[j-lookback]>2*LOOKBACK_MAX) {
            break;
          }
          double currentSum = dp[i-1][j-lookback];
          for (int l=j-lookback+1; l<=j; l++) { // This loop could be removed using prefix sums.
            if (distances[l]-distances[j-lookback] < distances[j]-distances[l]) {
              // City is closer to the previous station.
              currentSum += populations[l]*Math.pow(2, distances[j-lookback]-distances[l]);
            } else {
              // City is closer to the new station.
              currentSum += populations[l]*Math.pow(2, distances[l]-distances[j]);
            }
          }
          if (currentSum>best)
            best = currentSum;
          lookback++;
        }
        // For far away cities, use the lookbackBest result.
        if (lookback<=j) {
          double farBackSum = lookbackBest[i-1][j-lookback]; 
          for (int l=0; l<=LOOKBACK_MAX; l++) {
            if (l<=j && distances[j]-distances[j-l]<=LOOKBACK_MAX) {
              farBackSum += populations[j-l]*Math.pow(2, distances[j-l]-distances[j]);
            }
          }
          if (farBackSum>best)
            best = farBackSum;
        }
        dp[i][j] = best;
      }
      // Calculate the new lookbackBest value, possibly including this city as 
      // the location of the last station.
      for (int j=i; j<n; j++) {
        double sum = 0;
        for (int l=1; l<=LOOKBACK_MAX; l++) {
          if (j+l<n && distances[j+l]-distances[j]<=LOOKBACK_MAX) {
            sum += populations[j+l]*Math.pow(2, distances[j] - distances[j+l]);
          }
        }
        lookbackBest[i][j] = Math.max(lookbackBest[i][j-1], dp[i][j] + sum);
      }
    }
    System.out.println(lookbackBest[k-1][n-1]);
  }
}
