#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100007];
int main() {
  int n;
  double s;
  cin >> n >> s;
  if (n == 2) {
    cout << s << "\n";
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() == 1) c++;
  }
  cout << fixed << showpoint << setprecision(9);
  cout << (2 * s) / c << "\n";
  return 0;
}
