#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n, s;
int a[N], b[N];
int in[N], out[N];
int main() {
  cin >> n >> s;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    in[u]++;
    out[v]++;
    in[v]++;
    out[u]++;
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (out[i] == 1 && in[i] == 1) cnt++;
  double ans = 2 * s / (double)cnt;
  printf("%lf", ans);
  return 0;
}
