#include <stdio.h>
#include <algorithm>
#define NMAX 305
#define pdd pair <double,double>
#define x first
#define y second
#define eps 0.00001
#define INF 1000000000
using namespace std;
int n,k,r;
pdd A[NMAX],st[NMAX];
double B[NMAX],C[NMAX],D[NMAX],E[NMAX][NMAX],best[NMAX][NMAX],rez;
void read()
{
	scanf("%d%d",&n,&k);
	int i;
	for (i=1; i<=n; i++)
		scanf("%lf%lf",&A[i].x,&A[i].y);
	n++;
}
bool comp(pdd a,pdd b)
{
	if (a.y<b.y)
		return 1;
	if (a.y>b.y)
		return 0;
	if (a.x<b.x)
		return 1;
	return 0;
}
inline int semn(pdd a,pdd b,pdd c)
{
	double A=a.y-b.y;
	double B=b.x-a.x;
	double C=a.x*b.y-b.x*a.y;
	double val=(A*c.x+B*c.y+C);
	return (val<0);
}
void convex_hull()
{
	sort(A+1,A+n+1,comp);
	int i;
	st[++r]=A[1]; st[++r]=A[2];
	for (i=3; i<=n; i++)
	{
		while (r>=2 && semn(st[r-1],st[r],A[i])) r--;
		st[++r]=A[i];
	}
}
inline double min(double x,double y)
{
	return x<y ? x : y;
}
inline double modul(double x)
{
	return x<0 ? -x : x;
}
void precompute()
{
	int i,j,t;
	double a1,b1,c1,a2,b2,c2,xint,val1,val2;
	//i...i+1
	for (i=1; i<=r-1; i++)
	{
		a1=st[i].y-st[i+1].y;
		b1=st[i+1].x-st[i].x;
		c1=st[i].x*st[i+1].y-st[i+1].x*st[i].y;
		for (j=1; j<=n; j++)
			if (A[j].y+eps>st[i].y && A[j].y-eps<st[i+1].y)
			{
				if (modul(b1)<eps)
					xint=st[i].x;
				else
					xint=(-c1-b1*A[j].y)/a1;
				B[i]+=xint-A[j].x;
			}
	}
	
	//1..i
	for (i=1; i<=r-1; i++)
	{
		a1=st[i].y-st[i+1].y;
		b1=st[i+1].x-st[i].x;
		c1=st[i].x*st[i+1].y-st[i+1].x*st[i].y;
		for (j=1; j<=n; j++)
			if (A[j].y-eps<st[i+1].y)
			{
				if (modul(b1)<eps)
					xint=st[i].x;
				else
					xint=(-c1-b1*A[j].y)/a1;
				C[i]+=xint-A[j].x;
			}
	}
	
	//i...r
	for (i=1; i<=r-1; i++)
	{
		a1=st[i].y-st[i+1].y;
		b1=st[i+1].x-st[i].x;
		c1=st[i].x*st[i+1].y-st[i+1].x*st[i].y;
		for (j=1; j<=n; j++)
			if (A[j].y+eps>st[i+1].y)
			{
				if (modul(b1)<eps)
					xint=st[i].x;
				else
					xint=(-c1-b1*A[j].y)/a1;
				D[i]+=xint-A[j].x;
			}
	}
	
	//lipsa
	for (i=1; i<=r-1; i++)
	{
		a1=st[i].y-st[i+1].y;
		b1=st[i+1].x-st[i].x;
		c1=st[i].x*st[i+1].y-st[i+1].x*st[i].y;
		for (j=i+2; j<=r-1; j++)
		{
			a2=st[j].y-st[j+1].y;
			b2=st[j+1].x-st[j].x;
			c2=st[j].x*st[j+1].y-st[j+1].x*st[j].y;
			for (t=1; t<=n; t++)
				if (A[t].y+eps>st[i+1].y && A[t].y-eps<st[j+1].y)
				{
					if (modul(b1)<eps)
						xint=st[i].x;
					else
						xint=(-c1-b1*A[t].y)/a1;
					val1=xint-A[t].x;
					
					if (modul(b2)<eps)
						xint=st[j].x;
					else
						xint=(-c2-b2*A[t].y)/a2;
					val2=xint-A[t].x;
					E[i+1][j+1]+=min(val1,val2);
				}
		}
	}
}
void solve()
{
	int i,j,t;
	for (i=1; i<=r; i++)
		for (j=0; j<=k; j++)
			best[i][j]=INF;
	for (i=2; i<=r; i++)
		best[i][1]=C[i-1];
	for (i=2; i<r; i++)
		for (j=1; j<k; j++)
		{
			best[i+1][j+1]=min(best[i+1][j+1],best[i][j]+B[i]);
			for (t=i+2; t<=r; t++)
				best[t][j+1]=min(best[t][j+1],best[i][j]+E[i][t]);
		}
	rez=INF;
	for (i=2; i<=r; i++)
		for (j=1; j<=k; j++)
			rez=min(rez,best[i][j]+D[i-1]);
}
int main()
{
	freopen("insula2.in","r",stdin);
	freopen("insula2.out","w",stdout);
	read();
	convex_hull();
	precompute();
	solve();
	printf("%.4lf\n",rez);
	return 0;
}
