#include <bits/stdc++.h>
using namespace std;
int d[100100];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, a, b; i < n; i++) scanf("%d%d", &a, &b), d[a]++, d[b]++;
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (d[i] == 1) cnt++;
  printf("%.10f", 2.0 * m / cnt);
  return 0;
}
