#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int N, S;
  cin >> N >> S;
  vvi adj(N);
  for (int e = 0; e < N - 1; e++) {
    int u, v;
    cin >> u >> v;
    adj[u - 1].push_back(v - 1);
    adj[v - 1].push_back(u - 1);
  }
  int leafs = 0;
  for (auto& v : adj) leafs += v.size() == 1;
  cout << fixed << setprecision(15);
  cout << S * 2.0 / leafs << endl;
  return 0;
}
