#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using f64 = double;
using f80 = long double;
using pii = pair<int, int>;
using pll = pair<i64, i64>;
using ptx = pair<f64, f64>;
const int N = 3e5 + 5;
int deg[N];
int n, s, leaves;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> s;
  for (int u, v, i = 1; i < n; ++i) {
    cin >> u >> v;
    ++deg[u], ++deg[v];
  }
  for (int i = 1; i <= n; ++i)
    if (deg[i] == 1) ++leaves;
  cout << setprecision(10) << fixed;
  cout << 2.0 * s / leaves << endl;
  return 0;
}
