#include <bits/stdc++.h>
using namespace std;
int a[100000];
int main() {
  int u, r;
  double n, s, res;
  cin >> n >> s;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> r;
    a[u - 1]++;
    a[r - 1]++;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) res++;
  }
  double b = s / res * 2;
  cout << setprecision(12);
  cout << fixed << b;
}
