// O(kn log^2 (1/EPS)) time solution to train line.
// Here, M = 2 * 1/EPS. Basically, an area at distance
// M/2 or more from a station will have negligible impact
// on the utility function.
#include <iostream>
#include <vector>
#include <cmath>

#define M 60LL

using namespace std;

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

int main() {
    ll n, k;
    cin >> n >> k;

    vi p(n);
    vi d(n);
    for (ll i = 0; i < n; ++i) {
        cin >> p[i] >> d[i];
    }

    // dp(i, j) := max utility in prefix [0 to i] using j stations
    // note: would reduce cache misses if indices i and j are swapped, but
    // shouldn't be a big deal.
    vvd dp(n, vd(k+1, 0));

    for (ll j = 1; j <= k; ++j) {
        for (ll i = 0; i < n; ++i) {
            dp[i][j] = dp[i][j-1];            // can choose not to place the kth
            if (i > 0) {                      // station, or choose not to cover
                dp[i][j] = max(dp[i][j], dp[i-1][j]);  // station i at all.
            }

            ll width = min(M, i+1);   // maximum range covered by the last station
            vd value;   // value[m] = current value of placing a station at
                        // i-m, updated as the range covered goes from [i, i]
                        // to [i-M, i]

            for (ll l = 0; l < width; ++l) {
                T cur_val = p[i-l];   // current value of a station at i-l covering
                                      // [i-l, i]
                for (ll m = 0; m < value.size(); ++m) {
                    cur_val += p[i-m] * pow(2, -(d[i-m] - d[i-l]));
                }

                value.push_back(cur_val);
                T iter_best = cur_val;   // maximum value station covering [i-l, i]
                for (ll m = 0; m < value.size()-1; ++m) {
                    value[m] += p[i-l] * pow(2, -(d[i-m] - d[i-l]));
                    iter_best = max(iter_best, value[m]);
                }

                T cur_ans = iter_best;
                if (i-l-1 >= 0) {
                    cur_ans += dp[i-l-1][j-1];
                }
                dp[i][j] = max(dp[i][j], cur_ans);  // we explore every possible
                                                    // way to cover population i
            }
        }
    }

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