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>
using namespace std;
#define pii pair<int, int>
#define f first
#define s second

pii slope(pii a, pii b){
    pii res = {a.f-b.f, a.s-b.s};
    int gd = __gcd(abs(a.f-b.f), abs(a.s-b.s));
    res.f /= gd, res.s /= gd;
    if(res.f<0 || (res.f==0 && res.s<0))
        res.f = -res.f, res.s = -res.s;
    return res;
}

double dist(pii a, pii b){
    return sqrt(1ll*(a.f-b.f)*(a.f-b.f)+1ll*(a.s-b.s)*(a.s-b.s));
}

int main(){
    // freopen("a.in", "r", stdin);
    cout << fixed << setprecision(10);
    cin.tie(0)->sync_with_stdio(0);
    int n, k; cin >> n >> k; --k;
    vector<pii> points(n);
    for(int i = 0; i<n; ++i)
        cin >> points[i].f >> points[i].s;
    set<pii> check;
    for(int i = 1; i<n; ++i)
        check.insert(slope(points[0], points[i]));
    pii bad; int id_bad;
    if((int)check.size()==n-1)
        bad = points[0], id_bad = 0;
    else{
        assert((int)check.size()==2);
        vector<int> tmp1, tmp2;
        pii s1 = (*check.begin()), s2 = (*check.rbegin());
        for(int i = 1; i<n; ++i)
            if(slope(points[0], points[i])==s1) tmp1.push_back(i);
            else tmp2.push_back(i);
        if(tmp2.size()<tmp1.size()) swap(tmp1, tmp2);
        assert((int)tmp1.size()==1);
        bad = points[tmp1.back()], id_bad = tmp1.back();
    }
    pii bruh;
    if(k==id_bad) k = n-1;
    else bruh = points[k];
    vector<pii> line;
    for(int i = 0; i<n; ++i)
        if(i!=id_bad) line.push_back(points[i]);
    --n;
    sort(line.begin(), line.end());
    if(k!=n)
        for(int i = 0; i<n; ++i)
            if(line[i]==bruh) k = i;
    double ans = 1e18;
    if(k==n){
        ans = min(ans, dist(bad, line.back())+dist(line.front(), line.back()));
        ans = min(ans, dist(bad, line.front())+dist(line.front(), line.back()));
        cout << ans << '\n';
        return 0;
    }
    if(k==n-1) ans = min(ans, dist(bad, line.front())+dist(line.front(), line.back()));
    if(k==0) ans = min(ans, dist(bad, line.back())+dist(line.front(), line.back()));
    for(int i = k; i<n; ++i)
        ans = min(ans, dist(line[k], line[i])+dist(line[i], line[0])+dist(line[0], bad)+dist(bad, line[min(i+1, n-1)])+dist(line[min(i+1, n-1)], line[n-1])),
        ans = min(ans, dist(line[k], line[0])+dist(line[0], line[i])+dist(line[i], bad)+dist(bad, line[min(i+1, n-1)])+dist(line[min(i+1, n-1)], line[n-1]));
    for(int i = 0; i<=k; ++i)
        ans = min(ans, dist(line[k], line[i])+dist(line[i], line[n-1])+dist(line[n-1], bad)+dist(bad, line[max(i-1, 0)])+dist(line[max(i-1, 0)], line[0])),
        ans = min(ans, dist(line[k], line[n-1])+dist(line[n-1], line[i])+dist(line[i], bad)+dist(bad, line[max(i-1, 0)])+dist(line[max(i-1, 0)], line[0]));
    cout << ans << '\n';
}