#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> v[N];
int ct = 0;
void dfs(int node, int anc = -1) {
  bool leaf = true;
  for (int to : v[node]) {
    if (to != anc) {
      leaf = false;
      dfs(to, node);
    }
  }
  if (leaf) ct++;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, s;
  cin >> n >> s;
  cout << fixed;
  cout << setprecision(10);
  if (n == 2) {
    cout << s * 1.0;
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int r = 0;
  while (v[r].size() == 1) r++;
  dfs(r, -1);
  cout << s / (double)ct * 2;
  return 0;
}
