#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100500;
int n, s;
vector<int> G[MAXN];
int main() {
  while (scanf("%d %d", &n, &s) >= 1) {
    for (int i = (0); i < (int)(n - 1); i++) {
      int u, v;
      scanf("%d %d", &u, &v);
      u--;
      v--;
      G[u].push_back(v);
      G[v].push_back(u);
    }
    if (n == 2) {
      printf("%d", s);
      continue;
    }
    int leaves = 0;
    for (int i = (0); i < (int)(n); i++)
      if (((int)G[i].size()) == 1) leaves++;
    printf("%.20Lf\n", (long double)s * 2 / leaves);
  }
  return 0;
}
