#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
mt19937 eng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 2e5 + 4;
int n;
double s;
vector<int> g[N];
void read() {
  cin >> n >> s;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
}
void solve() {
  read();
  int cnt = 0;
  for (int u = 1; u <= n; ++u) {
    cnt += ((int)((g[u]).size()) == 1);
  }
  s = 2. * s / cnt;
  cout << s;
}
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0), cin.tie(0);
  cout << setprecision(14) << fixed;
  int z = 1;
  while (z--) {
    solve();
  }
  return 0;
}
