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

public class trolleys_ia implements Runnable {
	
	private static final double EPS = 1e-9;
	private BufferedReader in;
	private PrintWriter out;
	final String defaultMessage = "wrong input format.";
	private int lineNumber;
	private int n;
	private int m;
	private int[] x;
	private int[] y;
	private double ans;
	
	public void run() {
		try {
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
	
	private void solve() throws IOException {
		in = new BufferedReader(new FileReader("trolleys.in"));
		out = new PrintWriter("trolleys.out");
		lineNumber = 0;
		String str = in.readLine();
		lineNumber++;
		StringTokenizer st = new StringTokenizer(str);
		n = Integer.parseInt(st.nextToken());
		m = Integer.parseInt(st.nextToken());
		assertEquality(n + " " + m, str, null);
		final int MAXN = 100000;
		final int MAXM = 100000;
		final int MAXCOORD = 10000;
		assertBounds(n, 2, MAXN, "N");
		assertBounds(m, 2, MAXM, "M");
		
		x = new int[n + 1];
		y = new int[n + 1];
		for (int i = 0; i < n; i++) {
			str = in.readLine();
			lineNumber++;
			st = new StringTokenizer(str);
			x[i] = Integer.parseInt(st.nextToken());
			y[i] = Integer.parseInt(st.nextToken());
			assertEquality(x[i] + " " + y[i], str, null);
			assertBounds(x[i], -MAXCOORD, MAXCOORD, "x[i]");
			assertBounds(y[i], -MAXCOORD, MAXCOORD, "y[i]");
		}
		x[n] = x[0];
		y[n] = y[0];
		str = in.readLine();
		lineNumber++;
		assertStatement(str == null, null);
		in.close();
		lineNumber = -1;
		
		double[] vx = new double[n];
		double[] vy = new double[n];
		double dist = 0d;
		double[] l = new double[n];
		for (int i = 0; i < l.length; i++) {
			l[i] = Math.hypot(x[i + 1] - x[i], y[i + 1] - y[i]);
			dist += l[i];
			vx[i] = (x[i + 1] - x[i]) / l[i];
			vy[i] = (y[i + 1] - y[i]) / l[i];
		}
		dist /= m;
		
		ans = dist;
		int p2 = 0;
		double q2 = dist;
		while (q2 - l[p2] > EPS) {
			q2 -= l[p2];
			p2++;
		}
		int p1 = 0;
		double q1 = 0d;
		double x01 = x[0];
		double y01 = y[0];
		double x02 = x[p2] + vx[p2] * q2;
		double y02 = y[p2] + vy[p2] * q2;
		boolean loop = true;
		while (loop) {
			double l1 = l[p1] - q1;
			double l2 = l[p2] - q2;
			double ll = Math.min(l1, l2);
			
			q1 += ll;
			q2 += ll;
			
			if (q1 + EPS > l[p1]) {
				q1 -= l[p1];
				p1++;
				if (p1 == n) {
					p1 = 0;
					loop = false;
				}
			}
			if (q2 + EPS > l[p2]) {
				q2 -= l[p2];
				p2++;
				if (p2 == n) {
					p2 = 0;
				}
			}
			
			double x1 = x[p1] + vx[p1] * q1;
			double y1 = y[p1] + vy[p1] * q1;
			double x2 = x[p2] + vx[p2] * q2;
			double y2 = y[p2] + vy[p2] * q2;
			
			relax(x02 - x01, y02 - y01, x2 - x1, y2 - y1);
			
			x01 = x1;
			y01 = y1;
			x02 = x2;
			y02 = y2;
		}
		
		
		out.println(ans);
		out.close();
	}
	
	private void relax(double x1, double y1, double x2, double y2) {
		ans = Math.min(ans, Math.hypot(x1, y1));
		ans = Math.min(ans, Math.hypot(x2, y2));
		double xx = x2 - x1;
		double yy = y2 - y1;
		double dd = Math.hypot(xx, yy);
		xx /= dd;
		yy /= dd;
		if ((Math.abs(xx) < EPS) && (Math.abs(yy) < EPS)) {
			return;
		}
		double d = yy * x2 - xx * y2;
		double x = yy * d;
		double y = -xx * d;
		if (x1 > x2) {
			double tmp = x1;
			x1 = x2;
			x2 = tmp;
		}
		if (y1 > y2) {
			double tmp = y1;
			y1 = y2;
			y2 = tmp;
		}
		if ((x + EPS > x1) && (x - EPS < x2) && (y + EPS > y1) && (y - EPS < y2)) {
			ans = Math.min(ans, Math.abs(d));
		}
	}
	
	private void assertBounds(int n, int lo, int hi, String varName) {
		assertStatement(n >= lo && n <= hi, varName + " is out of bounds.");
	}
	
	private void assertEquality(String s1, String s2, String msg) {
		assertStatement(s1.equals(s2), msg);
	}
	
	private void assertStatement(boolean st, String msg) {
		if (msg == null) {
			msg = defaultMessage;
		}
		if (lineNumber != -1) {
			msg = "Line " + lineNumber + ": " + msg;
		}
		if (!st) {
			System.out.println(msg);
			out.println(msg);
			out.close();
			throw new Error(msg);
		}
	}
	
	public static void main(String[] args) {
		new Thread(new trolleys_ia()).start();
	}
	
}
