#include <bits/stdc++.h>
using namespace std;
template <typename T>
T load() {
  T r;
  cin >> r;
  return r;
}
template <typename T>
vector<T> loadMany(int n) {
  vector<T> rs(n);
  generate(rs.begin(), rs.end(), &load<T>);
  return rs;
}
struct Dummyf {
  template <typename... Ts>
  void operator()(Ts&&...) {}
};
struct Graph {
  Graph(int n) : edges(n) {}
  void addEdge1(int a, int b) { edges[a].push_back(b); }
  void addEdge2(int a, int b) {
    addEdge1(a, b);
    addEdge1(b, a);
  }
  int size() const { return (int)edges.size(); }
  template <typename Pre = Dummyf, typename Post = Dummyf,
            typename PreE = Dummyf, typename PostE = Dummyf,
            typename FailE = Dummyf>
  void DFS(int source, Pre pre, Post post, PreE pree, PostE poste,
           FailE faile) const {
    auto visit = vector<bool>(size(), false);
    implDFS(source, visit, pre, post, pree, poste, faile);
  }
  template <typename Pre = Dummyf, typename Post = Dummyf,
            typename PreE = Dummyf, typename PostE = Dummyf,
            typename FailE = Dummyf>
  void implDFS(int v, vector<bool>& visit, Pre pre, Post post, PreE pree,
               PostE poste, FailE faile) const {
    visit[v] = true;
    pre(v);
    for (auto u : edges[v])
      if (not visit[u])
        pree(v, u), implDFS(u, visit, pre, post, pree, poste, faile),
            poste(v, u);
      else
        faile(v, u);
    post(v);
  }
  vector<vector<int>> edges;
};
Graph loadEdges(int n, int m) {
  auto g = Graph(n);
  for (auto i = 0; i < m; ++i) g.addEdge2(load<int>() - 1, load<int>() - 1);
  return g;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  auto n = load<int>();
  auto s = load<int>();
  auto tree = loadEdges(n, n - 1);
  auto leaves = 0;
  for (auto v = 0; v < n; ++v)
    if (tree.edges[v].size() == 1) ++leaves;
  cout << fixed << setprecision(18) << ((long double)(2 * s) / leaves) << '\n';
}
