#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
using namespace std;

typedef long double dbl;

const dbl inf = 1e18;
const int maxn = int(3e4)+5, maxk = 10, maxd = 12;

int n;
dbl p[maxn], d[maxn], memo[maxn][maxk];

dbl dp(int idx, int k)
{
	if (k < 0) return -inf;
	if (idx >= n) return 0.0;
	if(memo[idx][k] > -inf) return memo[idx][k];

	dbl res = dp(idx+1, k);
	int loc = idx;
	while(loc < n && d[loc] - d[idx] < maxd)
	{
		dbl leftv = 0.0, rightv = 0.0;
		for(int tidx = idx;tidx <= loc;tidx++) leftv += (p[tidx] * dbl(pow(2.0, d[tidx] - d[loc])));
		res = max(res, leftv + dp(loc+1, k-1));
		int rightm = loc+1;
		while (rightm < n && d[rightm] - d[loc] < maxd)
		{
			rightv += (p[rightm] * dbl(pow(2.0, d[loc] - d[rightm])));
			res = max(res, leftv + rightv + dp(rightm+1, k-1));
			rightm++;
		}
		loc++;
	}


	return memo[idx][k] = res;
}

int main(void)
{
	int k;
	scanf("%d%d", &n, &k);

	for(int i = 0;i < maxn;i++)
	{
		for(int j = 0;j < maxk;j++) memo[i][j] = -inf;
	}

	for(int i = 0;i < n;i++) scanf("%Lf%Lf", &p[i], &d[i]);

	printf("%Lf\n", dp(0, k));
}