#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, s, d[N], m;
int main() {
  int i, j, k, x, y;
  scanf("%d%d", &n, &s);
  for (i = 1; i < n; ++i) {
    scanf("%d%d", &x, &y);
    d[x]++;
    d[y]++;
  }
  for (i = 1; i <= n; ++i) m += (d[i] == 1);
  printf("%.12f", (double)s * 2 / m);
}
