#include <bits/stdc++.h>
using namespace std;
vector<int> g[1111111];
double sum;
int main() {
  double n, m;
  cin >> n >> m;
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    if (g[i].size() == 1) {
      sum++;
    }
  }
  double ans = (m / sum) * 2;
  if (n == 2) {
    cout << m;
  } else {
    cout << fixed << setprecision(15) << ans;
  }
}
