// O(n^2 k) DP

#include <iostream>
#include <vector>
#include <cmath>

#define INF 100000000

using namespace std;

typedef long long ll;
typedef long double T;
typedef vector<ll> vi;
typedef vector<T> vd;
typedef vector<vd> vvd;
typedef vector<vi> vvi;
typedef vector<ll> vi;
typedef vector<vi> vvi;

int main() {
    ll n, k;
    cin >> n >> k;
    vi p(n), d(n);
    for (ll i = 0; i < n; ++i) {
        cin >> p[i] >> d[i];
    }
    p.push_back(0); // make dummy last population so we can place a station there and determine the optimal solution across the rest of the line
    d.push_back(INF);
    ++n;
    ++k;

    vvd dp(k+1, vd(n, 0));   // dp(i, j) := best solution in prefix [0, j] using i stations with final station at population j
    for (ll i = 2; i <= k; ++i) {
        dp[i][0] = p[0];
    }
    for (ll j = 0; j < n; ++j) {
        for (ll l = 0; l <= j; ++l) {
            dp[1][j] += p[l] * pow(2, -(d[j]-d[l]));    // easiest way to handle initial conditions correctly is just precompute one station
        }
    }
    vvi opt(k+1, vi(n, 0)); // heuristic to speed the DP

    for (ll i = 2; i <= k; ++i) {
        for (ll j = 1; j < n; ++j) {
            ll m = j;     // first index in [l, j] with distance closer to j
            T last_u = p[j];    // utility of all areas in [m, j]
            T early_u = 0;  // utility of all areas in [l+1, m-1]
            dp[i][j] = dp[i-1][j];  // can choose not to place ith station

            for (ll l = j-1; l >= opt[i][j-1]; --l) {
                while (true) {
                    ll dist_to_j = d[j]-d[m-1];
                    ll dist_to_l = d[m-1]-d[l];
                    if (dist_to_j <= dist_to_l) {   // adjust m according to new l
                        --m;
                        last_u += p[m] * pow(2, -dist_to_j);        // add m utility to last_u
                        early_u -= p[m] * pow(2, -(d[m]-d[l]));   // subtract m utility from early_u
                    } else {
                        break;
                    }
                }

                T cur_ans = dp[i-1][l] + early_u + last_u;
                if (cur_ans > dp[i][j]) {
                    opt[i][j] = l;
                    dp[i][j] = cur_ans;
                }

                if (l > 0) {    // adjust early_u for next iteration
                    early_u *= pow(2, -(d[l]-d[l-1]));
                    early_u += p[l] * pow(2, -(d[l]-d[l-1]));
                }
            }
        }
    }

    cout.precision(17);    
    cout << dp[k][n-1] << endl;
}
