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<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstring>
#include<fstream>
#define mem(a,b) memset(a, b, sizeof(a))
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define per(i,b,a) for(int i = (b); i >= (a); i--)
#define N 200021
#define eps 1e-9
using namespace std;

struct point{
    double x, y;
    bool operator < (const point b) const{ return make_pair(x, y) < make_pair(b.x, b.y); }
    bool operator != (const point b) const{ return make_pair(x, y) != make_pair(b.x, b.y); }
    bool operator == (const point b) const{ return make_pair(x, y) == make_pair(b.x, b.y); }
};
vector<point> p, check;
struct line{ double a, b, c; };
int n, k;
int xk, yk;
point ex;

line get_line(point a, point b){
    return {b.y-a.y, a.x-b.x, b.x*a.y - a.x*b.y};
}

line get_vertical(line l, point k){
    if(fabs(l.a) < eps) return (line){1, 0, -k.x};
    double a = l.b/l.a, b = -1;
    double c = -(a*k.x + b*k.y);
    //cout<<"("<<a<<","<<b<<","<<c<<")\n";
    return (line){a, b, c};
}

point intersect(line a, line b){
    double x = (b.c*a.b - a.c*b.b) / (a.a*b.b - b.a*a.b);
    double y = a.b ? -(a.c + a.a*x) / a.b : -(b.c + b.a*x) / b.b;
    return {x, y};
}

double cal(vector<point> p){
    /*cout<<"calculating: \n";
    for(point pp : p) cout<<"("<<pp.x<<","<<pp.y<<") ";
    cout<<endl;*/
    double dis = 0;
    bool ok[10]; mem(ok, false);
    rep(i,0,(int)p.size()-2){
        dis += sqrt((p[i].x-p[i+1].x)*(p[i].x-p[i+1].x) + (p[i].y-p[i+1].y)*(p[i].y-p[i+1].y));
        {
            rep(j,0,(int)check.size()-1){
                if(p[i] != ex && p[i+1] != ex){
                    double a = check[j].x, b = p[i].x, c = p[i+1].x;
                    if(a >= min(b, c) && a <= max(b, c)) ok[j] = true;
                }
                if(p[i] == check[j] || p[i+1] == check[j]) ok[j] = true;
            }
        }
    }
    //rep(j,0,9) cout<<ok[j]<<" \n"[j == 9];
    rep(j,0,(int)check.size()-1) if(!ok[j]) return 1e12;
    return dis;
}

int main(){
    //freopen("data.in", "r", stdin);
    //freopen("test.out", "w", stdout);
    cin>>n>>k;
    p.resize(n);
    rep(i,0,n-1) scanf("%lf %lf", &p[i].x, &p[i].y);
    xk = p[k-1].x, yk = p[k-1].y;
    sort(p.begin(), p.end());
    //for(point pp : p) cout<<"("<<pp.x<<","<<pp.y<<") "; cout<<endl;

    line coline;
    rep(i,0,1) rep(j,i+1,2){
        line l = get_line(p[i], p[j]);
        int cnt = 0;
        point tmp;
        //cout<<"("<<l.a<<","<<l.b<<","<<l.c<<")\n";
        rep(k,0,n-1) if(fabs(p[k].x*l.a + p[k].y*l.b + l.c) > eps) cnt++, tmp = p[k];
        //cout<<i<<","<<j<<": "<<cnt<<endl;
        if(cnt <= 1) coline = l, ex = tmp;
    }
    //cout<<"ex: ("<<ex.x<<","<<ex.y<<")\n";
    p.erase(lower_bound(p.begin(), p.end(), ex));
    n--;

    vector<point> node;
    int pos = lower_bound(p.begin(), p.end(), (point){xk, yk}) - p.begin();
    node.push_back((point){xk, yk});
    if(p[pos].x == xk && p[pos].y == yk){
        if(pos < n-1) node.push_back(p[pos+1]);
        if(pos > 0) node.push_back(p[pos-1]);
        if(pos < n-2) check.push_back(p[pos+2]);
        if(pos > 1) check.push_back(p[pos-2]);
    }
    node.push_back(p.front()), node.push_back(p.back());
    if(n > 1) check.push_back(p[1]), check.push_back(p[n-2]);

    node.push_back(ex);
    point itc = intersect(coline, get_vertical(coline, ex));
    //cout<<"intersect: ("<<itc.x<<","<<itc.y<<")\n";
    pos = lower_bound(p.begin(), p.end(), itc) - p.begin();
    if(pos < n) node.push_back(p[pos]);
    if(pos+1 < n) node.push_back(p[pos+1]);
    if(pos > 1) node.push_back(p[pos-1]);
    sort(node.begin()+1, node.end());
    node.erase(unique(node.begin()+1, node.end()), node.end());
    node.erase(node.begin()+3);

    /*for(point pp : node) cout<<"("<<pp.x<<","<<pp.y<<") ";
    cout<<endl;
    for(point pp : check) cout<<"("<<pp.x<<","<<pp.y<<") ";
    cout<<endl;*/

    double ans = 1e12;
    int m = node.size(), num = 1;
    rep(i,1,m-1) num *= i;
    while(num--){
        double val = cal(node);
        if(ans > val){
            ans = val;
            //for(point pp : node) cout<<"("<<pp.x<<","<<pp.y<<") ";
            //cout<<endl;
        }
        //ans = min(ans, cal(node));
        next_permutation(node.begin()+1, node.end());
    }

    printf("%.6f\n", ans);
    return 0;
}
/*
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
*/