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
#include<bits/stdc++.h>
#define pi 3.141592653589793238
#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#define MOD 1000000007
#define INF 999999999999999999 
#define pb push_back
#define ff first
#define ss second
#define mt make_tuple

#define printclock cerr<<"Time : "<<1000*(long long double)clock()/(long long double)CLOCKS_PER_SEC<<"ms\n";
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll B) { return (unsigned ll)rng() % B;}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
long double dist(pair<ll, ll> a, pair<ll,ll> b){
	long double dx = a.ff - b.ff;
	long double dy = a.ss - b.ss;
	return sqrt((dx * dx + dy * dy));
} 
ll bx,by;
long double havefun(int l,int r,auto & good){
	long double ans = 2e9;
	for(int i=l;i<r;i++){
		ans = min(ans, dist(good[l],good[r]) - dist(good[i],good[i+1]) + dist({bx,by}, good[i]) + dist({bx,by}, good[i+1]));
	}
	return ans;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    fast;
    ll _T = 1;
    
    //cin >> _T;
    while (_T--) {
        ll n, k;
        cin >> n >> k;
        k--;
        vector<array<ll,3>> v(n);
        for(int i = 0; i < n; i++){
            cin >> v[i][0] >> v[i][1];
            v[i][2] = i + 1;
        }
		ll sx, sy;
        

        sx = v[k][0], sy = v[k][1];
        sort(v.begin(), v.end());
        
		
		
        
		map<pair<ll,ll>, ll> slopes;
		for(int i = 1; i < n; i++){
			ll dy, dx;
			dy = v[i][1] - v[0][1];
			dx = v[i][0] - v[0][0];
			ll g = gcd(abs(dx), abs(dy));
			dx /= g, dy /= g;
			slopes[{dy, dx}]++;
		}
		assert((int)slopes.size() != 1);
		ll id = -1;
		if((int)slopes.size() == 2){
			for(int i = 1; i < n; i++){
				ll dy, dx;
				dy = v[i][1] - v[0][1];
				dx = v[i][0] - v[0][0];
				ll g = gcd(abs(dx), abs(dy));
				dx /= g, dy /= g;
				if(slopes[{dy, dx}] == 1){
					bx = v[i][0], by = v[i][1];
					break;
				}
			}
		}
		else{
			bx = v[0][0], by = v[0][1];
		}
		//cout << bx << " $ " << by << "\n";
        vector<pair<ll,ll>> good;
		
        for(int i = 0; i < n; i++){
            if(v[i][0] == bx && v[i][1] == by){
                continue;
            }
			if(v[i][0] == sx && v[i][1] == sy){
				id = (int)good.size() - 1;
			}
            good.pb({v[i][0], v[i][1]});
        }
        if(sx == bx && sy == by){
			long double ans = dist(good[0], {bx, by});
			ans = min(ans, dist(good[n - 2], {bx, by}));
			ans += dist(good[0], good[n - 2]);
            //cout << "$$$\n";
			cout << fixed << setprecision(10) << ans << "\n";
		}
		else{
			//cout << id << "###\n";
			long double ans = 2e9;
			if(id == 0||id == good.size()-1){
				ans = min(ans, havefun(0, good.size()-1, good));
			}
			else{
				long double tmp = dist(good[id], good[0])+dist({bx,by}, good[0])+dist({bx,by}, good[id+1])+dist(good[id+1],good.back());
				ans = min(ans, tmp);
				tmp = dist(good[id], good.back())+dist({bx,by}, good.back())+dist({bx,by}, good[id-1])+dist(good[id-1],good[0]);
				ans = min(ans, tmp);
				ans = min(ans, 2.0*dist(good[0], good[id]) + havefun(id,good.size()-1, good));
				ans = min(ans, 2.0*dist(good[id], good.back()) + havefun(0, id, good));
			}
			cout<<fixed<<setprecision(10)<<ans<<'\n';
			
		}
    }
    return 0;
}