You are given N points on an infinite plane with the Cartesian coordinate system on it. N-1 points lay on one line, and one point isn't on that line. You are on point K at the start, and the goal is to visit every point. You can move between any two points in a straight line, and you can revisit points. What is the minimum length of the path? 

Input

The first line contains two integers: N (3 ≤ N ≤ 2*10^5) - the number of points, and K (1 ≤ K ≤ N) - the index of the starting point.

Each of the next N lines contain two integers, A_i, B_i (-10^6 ≤ A_i, B_i ≤ 10^6) - coordinates of the i-th point.

Output

The output contains one number - the shortest path to visit all given points starting from point K. The absolute difference between your solution and the main solution shouldn't exceed 10^-6;

Example

Input


5 2
0 0
-1 1
2 -2
0 1
-2 2


Output


7.478709

Note

The shortest path consists of these moves: 

2 -> 5 

5 -> 4 

4 -> 1 

1 -> 3 

There isn't any shorter path possible.
4 1
768074 -27
-768090 -27
-8 -27
595283 233253
 4 3
-733 -804
-4 -755
725 -706
-895 -822
 16 8
-562856 268
-422202 268
281068 268
703030 268
-984818 268
-240 268
-844164 268
421722 268
-281548 268
34672 722872
562376 268
-703510 268
-140894 268
140414 268
843684 268
984338 268

1697753.3898821024 1624.2867736884 3781378.4984290055
#pragma GCC optimize("Ofast","inline","-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#define INF 1000000007.0
using namespace __gnu_pbds;
using namespace std;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int n,k,x[200010],y[200010];
bool vis[200010];

double dist(int xa,int ya,int xb,int yb)
{
	return sqrt(1ll*(xa-xb)*(xa-xb)+1ll*(ya-yb)*(ya-yb));
}

signed main()
{
	ios::sync_with_stdio(false);
	cin>>n>>k;
	for(int i=1;i<=n;i++) cin>>x[i]>>y[i];
	vector<pair<int,int> > v;
	v.push_back(make_pair(x[1],1));
	v.push_back(make_pair(x[2],2));
	for(int i=3;i<=n;i++){
		if(1ll*(y[2]-y[1])*(x[i]-x[1])==1ll*(y[i]-y[1])*(x[2]-x[1])) v.push_back(make_pair(x[i],i));
	}
	if(v.size()!=n-1){
		v.clear();
		v.push_back(make_pair(x[1],1));
		v.push_back(make_pair(x[3],3));
		for(int i=2;i<=n;i++) if(i!=3){
			if(1ll*(y[3]-y[1])*(x[i]-x[1])==1ll*(y[i]-y[1])*(x[3]-x[1])) v.push_back(make_pair(x[i],i));
		}
		if(v.size()!=n-1){
			v.clear();
			v.push_back(make_pair(x[2],2));
			v.push_back(make_pair(x[3],3));
			for(int i=1;i<=n;i++) if(i!=2&&i!=3){
				if(1ll*(y[3]-y[2])*(x[i]-x[2])==1ll*(y[i]-y[2])*(x[3]-x[2])) v.push_back(make_pair(x[i],i));
			}
		}
	}
	sort(v.begin(),v.end());
	for(int i=0;i<v.size();i++) vis[v[i].second]=1;
	int id=-1;
	for(int i=1;i<=n;i++) if(!vis[i]){
		id=i;break;
	}
	int pos=-1;
	for(int i=0;i<v.size();i++) if(v[i].second==k){
		pos=i;break;
	}
	double now=dist(v[0].first,y[v[0].second],v.back().first,y[v.back().second]);
	if(pos==-1){
		double val1=dist(v[0].first,y[v[0].second],x[id],y[id]);
		double val2=dist(v.back().first,y[v.back().second],x[id],y[id]);
		cout<<fixed<<setprecision(10)<<min(val1,val2)+now<<'\n';
	}
	else if(pos==0){
		double ans=INF;
		for(int i=0;i<v.size()-1;i++){
			double val=dist(v[0].first,y[v[0].second],v[i].first,y[v[i].second]);
			double val1=dist(v[i+1].first,y[v[i+1].second],x[id],y[id]);
			double val2=dist(v.back().first,y[v.back().second],x[id],y[id]);
			double t=dist(v[i+1].first,y[v[i+1].second],v.back().first,y[v.back().second]);
			ans=min(ans,val+min(val1,val2)+t);
		}
		double len=dist(v.back().first,y[v.back().second],x[id],y[id]);
		ans=min(ans,dist(v[0].first,y[v[0].second],v.back().first,y[v.back().second])+len);
		cout<<fixed<<setprecision(10)<<ans<<'\n';
	}
	else if(pos==v.size()-1){
		double ans=INF;
		reverse(v.begin(),v.end());
		for(int i=0;i<v.size()-1;i++){
			double val=dist(v[0].first,y[v[0].second],v[i].first,y[v[i].second]);
			double val1=dist(v[i+1].first,y[v[i+1].second],x[id],y[id]);
			double val2=dist(v.back().first,y[v.back().second],x[id],y[id]);
			double t=dist(v[i+1].first,y[v[i+1].second],v.back().first,y[v.back().second]);
			ans=min(ans,val+min(val1,val2)+t);
		}
		double len=dist(v.back().first,y[v.back().second],x[id],y[id]);
		ans=min(ans,dist(v[0].first,y[v[0].second],v.back().first,y[v.back().second])+len);
		cout<<fixed<<setprecision(10)<<ans<<'\n';
	}
	else{
		double ans=INF;
		for(int i=pos;i<v.size()-1;i++){
			double val=dist(v[pos].first,y[v[pos].second],v[i].first,y[v[i].second]);
			val+=dist(v[i].first,y[v[i].second],x[id],y[id]);
			double val1=dist(v[0].first,y[v[0].second],x[id],y[id]);
			double val2=dist(v.back().first,y[v.back().second],x[id],y[id]);
			ans=min(ans,val+min(val1,val2)+now);
		}
		double u=dist(v[pos].first,y[v[pos].second],v.back().first,y[v.back().second]);
		for(int i=v.size()-1;i>=pos;i--){
			double val=dist(v[i].first,y[v[i].second],v.back().first,y[v.back().second]);
			val+=dist(v[i].first,y[v[i].second],x[id],y[id]);
			double val1=dist(v[0].first,y[v[0].second],x[id],y[id]);
			double val2=dist(v[pos-1].first,y[v[pos-1].second],x[id],y[id]);
			double t=dist(v[0].first,y[v[0].second],v[pos-1].first,y[v[pos-1].second]);
			ans=min(ans,u+val+min(val1,val2)+t);
		}
		u*=2.0;
		for(int i=pos-1;i>0;i--){
			double val=dist(v[pos].first,y[v[pos].second],v[i].first,y[v[i].second]);
			val+=dist(v[i].first,y[v[i].second],x[id],y[id]);
			double val1=dist(v[0].first,y[v[0].second],x[id],y[id]);
			double val2=dist(v[i-1].first,y[v[i-1].second],x[id],y[id]);
			double t=dist(v[0].first,y[v[0].second],v[i-1].first,y[v[i-1].second]);
			ans=min(ans,u+val+min(val1,val2)+t);
		}
		u+=dist(v[pos].first,y[v[pos].second],v[0].first,y[v[0].second]);
		ans=min(ans,u+dist(v[0].first,y[v[0].second],x[id],y[id]));
		reverse(v.begin(),v.end());pos=v.size()-pos-1;
		for(int i=pos;i<v.size()-1;i++){
			double val=dist(v[pos].first,y[v[pos].second],v[i].first,y[v[i].second]);
			val+=dist(v[i].first,y[v[i].second],x[id],y[id]);
			double val1=dist(v[0].first,y[v[0].second],x[id],y[id]);
			double val2=dist(v.back().first,y[v.back().second],x[id],y[id]);
			ans=min(ans,val+min(val1,val2)+now);
		}
		u=dist(v[pos].first,y[v[pos].second],v.back().first,y[v.back().second]);
		for(int i=v.size()-1;i>=pos;i--){
			double val=dist(v[i].first,y[v[i].second],v.back().first,y[v.back().second]);
			val+=dist(v[i].first,y[v[i].second],x[id],y[id]);
			double val1=dist(v[0].first,y[v[0].second],x[id],y[id]);
			double val2=dist(v[pos-1].first,y[v[pos-1].second],x[id],y[id]);
			double t=dist(v[0].first,y[v[0].second],v[pos-1].first,y[v[pos-1].second]);
			ans=min(ans,u+val+min(val1,val2)+t);
		}
		u*=2.0;
		for(int i=pos-1;i>0;i--){
			double val=dist(v[pos].first,y[v[pos].second],v[i].first,y[v[i].second]);
			val+=dist(v[i].first,y[v[i].second],x[id],y[id]);
			double val1=dist(v[0].first,y[v[0].second],x[id],y[id]);
			double val2=dist(v[i-1].first,y[v[i-1].second],x[id],y[id]);
			double t=dist(v[0].first,y[v[0].second],v[i-1].first,y[v[i-1].second]);
			ans=min(ans,u+val+min(val1,val2)+t);
		}
		u+=dist(v[pos].first,y[v[pos].second],v[0].first,y[v[0].second]);
		ans=min(ans,u+dist(v[0].first,y[v[0].second],x[id],y[id]));
		cout<<fixed<<setprecision(10)<<ans<<'\n';
	}
	return 0;
}
