// O(n log^2 (1/EPS) log (range)) time solution to train line.
import java.io.*;
import java.util.*;

public class Bryce {
    public static int M = 30;   // twice max effective distance

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        k = Math.min(k, n);

        int[] p = new int[n];
        double[] d = new double[n];
        for (int i = 0; i < n; ++i) {
            p[i] = in.nextInt();
            d[i] = in.nextInt();
        }

        double hi = 300;    // station utility cannot exceed 300
        double lo = 0;
        while(true) {
            double l = (hi+lo)/2;
            System.out.println(lo + " " + l + " " + hi);

            double[] dp = new double[n];  // dp[i] := max utility in prefix [0 to i] placing station at i
            int[] cnt = new int[n]; // the number of stations used in solution dp[i]
            double[] best = new double[n]; // best dp before i
            for (int i = 0; i < n; ++i) {
                
                double no_p = -l;
                for (int j = i; j >= Math.max(0, i-M); --j) {    // make this the first placed station
                    no_p += p[j] * Math.pow(2, -(d[i]-d[j]));
                }

                dp[i] = no_p;   // may be negative
                cnt[i] = 1;

                for (int j = i-1; j >= Math.max(0, i-M); --j) {    // use best solution at j
                    double cur = -l + dp[j];
                    for (int m = j+1; m <= i; ++m) {
                        double min_d = Math.min(d[m]-d[j], d[i]-d[m]);
                        cur += p[m] * Math.pow(2, -min_d);
                    }
                    if (cur > dp[i]) {
                        dp[i] = cur;
                        cnt[i] = cnt[j]+1;
                    }
                }
            }
            double best = 0;
            int best_cnt = 0;
            for (int i = 0; i < n; ++i) {
                double cur = dp[i];
                for (int j = i+1; j < Math.min(n, i+M); ++j) {
                    cur += p[j] * Math.pow(2, -(d[j]-d[i]));
                }
                if (cur > best) {
                    best = cur;
                    best_cnt = cnt[i];
                }
            }
               
            System.out.println(best_cnt);
            System.out.println(best + k*l);
            if (hi-lo < 1e-6 || best_cnt == k) {
                System.out.printf("%.6f\n", best + k*l);
                break;
            }

            if (best_cnt > k) {
                lo = l;
            } else {
                hi = l;
            }
        }
    }
}
