#include <bits/stdc++.h>
using namespace std;
int cnt[300010];
int main() {
  int n, s;
  scanf("%d%d", &n, &s);
  if (n == 2) return 0 * printf("%d\n", s);
  for (int i = 1; i <= n; i++) cnt[i] = 0;
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d%d", &u, &v);
    cnt[u]++;
    cnt[v]++;
  }
  int res = 0;
  for (int i = 1; i <= n; i++)
    if (cnt[i] == 1) res++;
  printf("%.10lf\n", (double)s * 2.0 / (double)res);
}
