#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, s, i, c = 0, deg[1000009] = {0};
  cin >> n >> s;
  for (i = 0; i < n - 1; i++) {
    long long int a, b;
    cin >> a >> b;
    deg[a]++;
    deg[b]++;
  }
  for (i = 0; i < 1000009; i++) {
    if (deg[i] == 1) c++;
  }
  double ans = (2.0 * s) / c;
  cout.precision(18);
  cout << fixed << ans;
  return 0;
}
