#include <bits/stdc++.h>
const int N = 100005;
const int M = 200005;
using namespace std;
double S, tot = 0;
int n, flag = 1;
int vis[N], edge[M], lst[N], nxt[M], t = 0;
void ADD(int x, int y) {
  edge[++t] = y;
  nxt[t] = lst[x];
  lst[x] = t;
}
void READ() {
  int u, v;
  scanf("%d%lf", &n, &S);
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d%d", &u, &v);
    ADD(u, v);
    ADD(v, u);
  }
}
void SEARCH(int x, int fa) {
  int cnt = 0, num = 0;
  vis[x] = 0;
  for (int r = lst[x]; r; r = nxt[r]) {
    if (edge[r] == fa) continue;
    SEARCH(edge[r], x);
    cnt++;
    if (!vis[edge[r]])
      num++;
    else
      vis[x] = 1;
  }
  if (cnt > 1) flag = 0, tot += num, vis[x] = 1;
  if (cnt == 1 && x == 1) tot++;
}
int main() {
  READ();
  SEARCH(1, 0);
  if (flag)
    printf("%.20lf\n", S);
  else
    printf("%.20lf\n", S * 2 / tot);
  return 0;
}
