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;
const int N = 200005;
int n, rb, b, m, d, od[N], sq[N], t;
struct pt {
  int x, y;
} r[N], a[N], v;
pt operator-(pt a, pt b) { return {a.x - b.x, a.y - b.y}; }
bool operator==(pt a, pt b) { return 1ll * a.x * b.y == 1ll * a.y * b.x; }
bool operator!=(pt a, pt b) { return 1ll * a.x * b.y != 1ll * a.y * b.x; }
double dis(int p, int q) {
  return sqrt((a[p].x - a[q].x) * (a[p].x - a[q].x) +
              (a[p].y - a[q].y) * (a[p].y - a[q].y));
}
double ans = 1e18, sum;
int main() {
  scanf("%d%d", &m, &rb);
  for (int i = 1; i <= m; i++) scanf("%d%d", &r[i].x, &r[i].y);
  sort(r + 1, r + m + 1,
       [&](pt a, pt b) { return (a.x == b.x) ? (a.y < b.y) : (a.x < b.x); });
  for (int i = 1; i <= m; i++) {
    if (i == 1 || r[i].x != r[i - 1].x || r[i].y != r[i - 1].y) a[++n] = r[i];
    if (i == rb) b = n;
  }
  if (n == 1) {
    printf("%.9lf\n", 0);
    return 0;
  }
  if (n == 2) {
    printf("%.9lf\n", dis(1, 2));
    return 0;
  }
  if (n == 3) {
    if (b == 1)
      printf("%.9lf\n", min(dis(1, 2) + dis(2, 3), dis(1, 3) + dis(1, 2)));
    if (b == 2)
      printf("%.9lf\n", min(dis(2, 1) + dis(1, 3), dis(2, 3) + dis(3, 1)));
    if (b == 3)
      printf("%.9lf\n", min(dis(3, 1) + dis(1, 2), dis(3, 2) + dis(2, 1)));
    return 0;
  }
  pt d1 = a[1] - a[2], d2 = a[1] - a[3], d3 = a[1] - a[4];
  if (d1 == d2)
    v = d1;
  else if (d1 == d3)
    v = d1;
  else
    v = d2, d = 1;
  if (!d)
    for (int i = 2; i <= n; i++)
      if ((a[i] - a[1]) != v) d = i;
  for (int i = 1; i <= n; i++) od[i] = i;
  sort(od + 1, od + n + 1, [&](int p, int q) {
    return (a[p].x == a[q].x) ? (a[p].y < a[q].y) : (a[p].x < a[q].x);
  });
  for (int i = 1; i <= n; i++) {
    if (i == b) {
      t = 0, sum = 0;
      if (i == d) {
        for (int j = 1; j <= n; j++)
          if (j != d) sq[++t] = j;
      } else {
        for (int j = i; j >= 1; j--)
          if (j != d) sq[++t] = j;
        for (int j = i + 1; j <= n; j++)
          if (j != d) sq[++t] = j;
      }
      for (int j = 1; j < n - 1; j++) sum += dis(sq[j], sq[j + 1]);
      ans = min(ans, sum + dis(d, sq[1]));
      ans = min(ans, sum + dis(d, sq[n - 1]));
      for (int j = 1; j < n - 1; j++)
        ans = min(ans, sum - dis(sq[j], sq[j + 1]) + dis(sq[j], d) +
                           dis(sq[j + 1], d));
      t = 0;
      if (i == d) {
        for (int j = n; j >= 1; j--)
          if (j != d) sq[++t] = j;
      } else {
        for (int j = i; j <= n; j++)
          if (j != d) sq[++t] = j;
        for (int j = i - 1; j >= 1; j--)
          if (j != d) sq[++t] = j;
      }
      sum = 0;
      for (int j = 1; j < n - 1; j++) sum += dis(sq[j], sq[j + 1]);
      ans = min(ans, sum + dis(d, sq[1]));
      ans = min(ans, sum + dis(d, sq[n - 1]));
      for (int j = 1; j < n - 1; j++)
        ans = min(ans, sum - dis(sq[j], sq[j + 1]) + dis(sq[j], d) +
                           dis(sq[j + 1], d));
    }
  }
  printf("%.9lf\n", ans);
  return 0;
}
