#include <bits/stdc++.h>
using namespace std;
int n;
double s;
vector<int> E[100005];
int dist[100005], pa[100005];
int dfs(int u, int p, int d) {
  dist[u] = d;
  int ans = u;
  for (int v : E[u]) {
    if (v == p) continue;
    int tmp = dfs(v, u, d + 1);
    pa[v] = u;
    if (dist[ans] < dist[tmp]) ans = tmp;
  }
  return ans;
}
int main() {
  scanf("%d%lf", &n, &s);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    E[u].push_back(v);
    E[v].push_back(u);
  }
  if (n == 2) {
    printf("%.10lf\n", s);
    return 0;
  }
  int l = 0;
  for (int i = 1; i <= n; i++) {
    if (E[i].size() == 1) l++;
  }
  printf("%.10lf\n", 2.0 * s / l);
  return 0;
}
