#include <bits/stdc++.h>
using namespace std;
const int INFL = (int)1e9;
const long long int INFLL = (long long int)1e18;
const double INFD = numeric_limits<double>::infinity();
const double PI = 3.14159265358979323846;
bool nearlyeq(double x, double y) { return abs(x - y) < 1e-9; }
bool inrange(int x, int t) { return x >= 0 && x < t; }
long long int rndf(double x) {
  return (long long int)(x + (x >= 0 ? 0.5 : -0.5));
}
long long int floorsqrt(double x) {
  long long int m = (long long int)sqrt(x);
  return m + (m * m <= (long long int)(x) ? 0 : -1);
}
long long int ceilsqrt(double x) {
  long long int m = (long long int)sqrt(x);
  return m + ((long long int)x <= m * m ? 0 : 1);
}
long long int rnddiv(long long int a, long long int b) {
  return (a / b + (a % b * 2 >= b ? 1 : 0));
}
long long int ceildiv(long long int a, long long int b) {
  return (a / b + (a % b == 0 ? 0 : 1));
}
long long int gcd(long long int m, long long int n) {
  if (n == 0)
    return m;
  else
    return gcd(n, m % n);
}
struct tree_t {
  int n;
  vector<pair<int, int>> edges;
  vector<long long int> vals;
  vector<long long int> costs;
};
class Tree {
 private:
  struct node {
    int id;
    vector<int> childs;
    int parent = -1;
    int deg = -1;
    int eid = -1;
    int subtree_n = 1;
    int visited = -1;
    int departed = -1;
    long long int val;
    long long int cost;
    bool operator<(const node& another) const {
      return deg != another.deg ? deg < another.deg : id < another.id;
    }
  };
  struct edgeinfo {
    int eid;
    int to;
    long long int cost;
  };
  int n;
  static const long long int init_val = 0;
  static const long long int init_cost = 1;
  vector<vector<edgeinfo>> edges;
  vector<vector<int>> sparse_ancestors;
  void tree_construction() {
    leaves = {};
    queue<int> que;
    que.push(root);
    while (que.size()) {
      int a = que.front();
      que.pop();
      deg_order.push_back(a);
      if (a == Tree::root) nodes[a].deg = 0;
      int leaf_flag = true;
      for (int i = 0; i < (int)edges[a].size(); i++) {
        int b = edges[a][i].to;
        if (nodes[b].deg != -1) {
          nodes[a].parent = b;
          nodes[a].eid = edges[a][i].eid;
          nodes[a].cost = edges[a][i].cost;
          nodes[a].deg = nodes[b].deg + 1;
        } else {
          leaf_flag = false;
          nodes[a].childs.push_back(b);
          que.push(b);
        }
      }
      if (leaf_flag) leaves.push_back(a);
    }
    for (int i = (int)n - 1; i >= 0; i--) {
      int a = deg_order[i];
      for (int j = 0; j < (int)nodes[a].childs.size(); j++) {
        int b = nodes[a].childs[j];
        nodes[a].subtree_n += nodes[b].subtree_n;
      }
    }
  }

 public:
  vector<node> nodes;
  vector<int> deg_order;
  vector<int> leaves;
  int root;
  Tree(tree_t T, int root = -1) {
    n = T.n;
    nodes.resize(n);
    for (int i = 0; i < (int)n; i++) {
      nodes[i].id = i;
      nodes[i].val = (int)(T.vals.size()) > i ? T.vals[i] : init_val;
      nodes[i].cost = init_cost;
    }
    edges.resize(n);
    for (int i = 0; i < (int)n - 1; i++) {
      edges[T.edges[i].first].push_back(
          {i, T.edges[i].second,
           ((int)(T.costs.size()) > i ? T.costs[i] : init_cost)});
      edges[T.edges[i].second].push_back(
          {i, T.edges[i].first,
           ((int)(T.costs.size()) > i ? T.costs[i] : init_cost)});
    }
    if (root < 0) {
      int max_d = -1;
      for (int i = 0; i < (int)n; i++) {
        if ((int)(edges[i].size()) > max_d) {
          Tree::root = i;
          max_d = edges[i].size();
        }
      }
    } else {
      this->root = min(root, n - 1);
    }
    tree_construction();
    return;
  }
};
int main() {
  int n;
  cin >> n;
  double s;
  cin >> s;
  tree_t T;
  T.n = n;
  for (int i = 0; i < (int)n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    T.edges.push_back({a, b});
  }
  Tree tree(T);
  if (n == 2)
    cout << s << endl;
  else
    cout << setprecision(12) << s / tree.leaves.size() * 2 << endl;
}
