import java.io.*;
import java.util.*;

public class trolleys_md_certify implements Runnable {
	private BufferedReader in;
	private PrintWriter out, aux;

	public void run() {
		try {
			solve();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	private void solve() throws IOException {
		Locale.setDefault(Locale.US);
		in = new BufferedReader(new FileReader("trolleys.in"));
		out = new PrintWriter("trolleys.out");
		aux = new PrintWriter("trolleys.aux");
		StringTokenizer st = new StringTokenizer(in.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		if (n < 2 || n > 100000)
			throw new Error("N = " + n);
		if (m < 2 || m > 100000)
			throw new Error("M = " + m);
		double[] x = new double[2 * n];
		double[] y = new double[2 * n];
		for (int i = 0; i < n; i++) {
			st = new StringTokenizer(in.readLine());
			x[i] = Integer.parseInt(st.nextToken());
			y[i] = Integer.parseInt(st.nextToken());
			if (Math.abs(x[i]) > 10000 || Math.abs(y[i]) > 10000)
				throw new Error("Bad coordinates in line " + i + ": (" + x[i] + ", " + y[i] + ")");
			x[i + n] = x[i];
			y[i + n] = y[i];
		}
		double l = 0;
		for (int i = 0; i < n; i++) {
			double s = Math.hypot(x[i + 1] - x[i], y[i + 1] - y[i]);
			if (s < 0.5)
				throw new Error("Points " + i + " and " + (i + 1) + " coincide");
			l += s;
		}
		if (in.readLine() != null)
			throw new Error("Extra lines");
		l /= m;
		int i = 0;
		int j = 0;
		double li = 0;
		double lj = 0;
		while (l > 0) {
			double s = Math.hypot(x[j + 1] - x[j], y[j + 1] - y[j]);
			if (l < s) {
				lj = l;
				break;
			}
			l -= s;
			j++;
		}
		while (i < n) {
			double s1 = Math.hypot(x[i + 1] - x[i], y[i + 1] - y[i]);
			double left1 = s1 - li;
			double s2 = Math.hypot(x[j + 1] - x[j], y[j + 1] - y[j]);
			double left2 = s2 - lj;
			x1 = x[i] + (x[i + 1] - x[i]) * li / s1;
			y1 = y[i] + (y[i + 1] - y[i]) * li / s1;
			x2 = x[j] + (x[j + 1] - x[j]) * lj / s2;
			y2 = y[j] + (y[j + 1] - y[j]) * lj / s2;
			dx = x2 - x1;
			dy = y2 - y1;
			vx1 = (x[i + 1] - x[i]) / s1;
			vy1 = (y[i + 1] - y[i]) / s1;
			vx2 = (x[j + 1] - x[j]) / s2;
			vy2 = (y[j + 1] - y[j]) / s2;
			vx = vx2 - vx1;
			vy = vy2 - vy1;
			len = Math.min(left1, left2);
			relax();
			left1 -= len;
			left2 -= len;
			li += len;
			lj += len;
			if (left1 <= 0) {
				li = 0;
				i++;
			}
			if (left2 <= 0) {
				lj = 0;
				j++;
			}
		}
		out.println(ansmin);
		aux.println(ansx1 + " " + ansy1);
		aux.println(ansx2 + " " + ansy2);
		in.close();
		out.close();
		aux.close();
	}
	
	double dx, dy, x1, y1, x2, y2, vx1, vy1, vx2, vy2, vx, vy, len;

	private void relax() {
		relax(0);
		relax(len);
		
		double a = vx * vx + vy * vy;
		double b = 2 * dx * vx + 2 * dy * vy;
//		double c = dx * dx + dy * dy;
		double t = -b / a * 0.5;
		if (t > 0 && t < len)
			relax(t);
	}

	private void relax(double t) {
		double d = Math.hypot(dx + vx * t, dy + vy * t);
		if (d < ansmin) {
			ansmin = d;
			ansx1 = x1 + vx1 * t;
			ansy1 = y1 + vy1 * t;
			ansx2 = x2 + vx2 * t;
			ansy2 = y2 + vy2 * t;
		}
	}
	
	double ansmin = 1e100;
	double ansx1, ansy1, ansx2, ansy2;

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

}
