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