#include <bits/stdc++.h>
using namespace std;
list<long long int> *a = new list<long long int>[1000001];
int main() {
  long long int n, p, q, s, leaf = 0;
  cin >> n >> s;
  for (int i = 1; i < n; i++) {
    cin >> p >> q;
    a[p].push_back(q);
    a[q].push_back(p);
  }
  for (int i = 1; i <= n; i++) {
    if (a[i].size() == 1) leaf++;
  }
  double ans = (double)((2.0 * s) / leaf);
  ;
  printf("%0.12lf", ans);
  return 0;
}
