#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
int grad[1 + MAX_N];
int ma[MAX_N - 1], mb[MAX_N - 1];
int main() {
  FILE *fin = stdin;
  FILE *fout = stdout;
  int n, s;
  fscanf(fin, "%d%d", &n, &s);
  for (int i = 0; i < n - 1; ++i) {
    fscanf(fin, "%d%d", &ma[i], &mb[i]);
    grad[ma[i]]++;
    grad[mb[i]]++;
  }
  int rez = 0;
  for (int i = 0; i < n - 1; ++i)
    if (grad[ma[i]] == 1 || grad[mb[i]] == 1) ++rez;
  if (n == 2)
    fprintf(fout, "%d", s);
  else
    fprintf(fout, "%.10lf", (double)s / rez * 2);
  return 0;
}
