import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


public class trolleys_dp_bad implements Runnable {

    private static final double INF = 1e9;
    
    private Scanner in;
    private PrintWriter out;
    private double distance;
    private int n;
    private Point[] points;

    private double answer;

    private double ansX1;
    private double ansY1;
    private double ansX2;
    private double ansY2;

    private final static double EPS = 1e-9;

    public void solve() {
        n = in.nextInt();
        int m = in.nextInt();
        points = new Point[n + 1];
        for (int i = 0; i < n; i++) {
            points[i] = new Point(in.nextInt(), in.nextInt());
        }
        points[n] = points[0];
        distance = 0;
        for (int i = 0; i < n; i++) {
            distance += dist(points[i], points[i + 1]);
        }
        distance /= m;
        answer = INF;
        int ind1 = 0;
        int ind2 = 0;
        double dist = 0;
        while (ind1 < n) {
            while (dist < distance) {
                relax(ind1, ind2, dist);
                dist += dist(points[ind2], points[ind2 + 1]);
                ind2 = (ind2 + 1) % n;
            }
            dist -= dist(points[ind1], points[ind1 + 1]);
            ind1++;
        }
        out.println(answer);
        System.out.println(ansX1 + " " + ansY1);
        System.out.println(ansX2 + " " + ansY2);
    }
    
    private void relax(int ind1, int ind2, double dist) {
        dist = distance - dist;
        if (dist < 0) {
            return;
        }
        
        Point v1 = points[(ind1 + n - 1) % n].diff(points[ind1]);
        double t1 = Math.hypot(v1.x, v1.y);
        v1 = v1.normalize();
        Point v2 = points[(ind2 + 1) % n].diff(points[ind2]);
        double t2 = Math.hypot(v2.x, v2.y);
        v2 = v2.normalize();
        
        Point p1 = points[ind1];
        Point p2 = points[ind2];
        double t0 = dist;
        double dx = v1.x + v2.x;
        double dy = v1.y + v2.y;
        double t = (dx * (t0 * v2.x + p2.x - p1.x) + dy * (t0 * v2.y + p2.y - p1.y)) / (dx * dx + dy * dy);
        List<Double> list = new ArrayList<Double>();
        list.add(0.0);
        list.add(t);
        list.add(t1);
        list.add(t2);
        list.add(t0 - t2);
        for (double time1: list) {
            double time2 = t0 - time1;
            if (time1 < -EPS || time2 < -EPS || time1 > t1 + EPS || time2 > t2 + EPS) {
                continue;
            }
            double tmpX1 = p1.x + time1 * v1.x;
            double tmpX2 = p2.x + time2 * v2.x;
            double tmpY1 = p1.y + time1 * v1.y;
            double tmpY2 = p2.y + time2 * v2.y;
            double d = Math.hypot(tmpX1 - tmpX2, tmpY1 - tmpY2);
            if (answer > d) {
                answer = d;
                ansX1 = tmpX1;
                ansY1 = tmpY1;
                ansX2 = tmpX2;
                ansY2 = tmpY2;
            }
        }
    }

    private double dist(Point p1, Point p2) {
        return Math.hypot(p1.x - p2.x, p1.y - p2.y);
    }

    class Point {
        double x;
        double y;
        
        Point(double xx, double yy) {
            x = xx;
            y = yy;
        }

        public Point normalize() {
            double d = Math.hypot(x, y);
            return new Point(x / d, y / d);
        }

        public Point diff(Point p) {
            return new Point(x - p.x, y - p.y);
        }
        
        public String toString() {
            return String.format("(%.3f, %.3f)", x, y);
        }
    }
    
    public void run() {
        try {
            solve();
        } finally {
            out.close();
        }
    }

    public trolleys_dp_bad(String file) {
        try {
            in = new Scanner(new File(file + ".in"));
            out = new PrintWriter(new File(file + ".out"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            System.exit(239);
        }
    }

    public static void main(String[] args) {
        new Thread(new trolleys_dp_bad("trolleys")).start();
    }
}
