#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
int n;
long double m;
int main() {
  cin >> n >> m;
  g.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    int v, u;
    cin >> v >> u;
    --v, --u;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  long long k = 0;
  for (int i = 0; i < n; ++i) {
    if (g[i].size() == 1) k += 1;
  }
  long double itog = 2 * m / k;
  cout << fixed << setprecision(24) << itog << endl;
  return 0;
}
