#include <bits/stdc++.h>
using namespace std;
struct Timer {
  chrono::time_point<chrono::high_resolution_clock> start, end;
  chrono::duration<float> dur;
  Timer() { start = chrono::high_resolution_clock::now(); }
  ~Timer() {
    end = chrono::high_resolution_clock::now();
    dur = end - start;
    cout << "\nTime Elapsed : " << dur.count() << " s\n";
  }
};
long long int sum() { return 0; }
template <typename T, typename... Args>
T sum(T a, Args... args) {
  return a + sum(args...);
}
template <int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template <typename... Args>
  Vec(int n = 0, Args... args)
      : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {}
};
template <typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, T val = T()) : vector<T>(n, val) {}
};
template <typename T>
class SieveEuler {
 public:
  vector<T> primes;
  vector<T> lp;
  inline SieveEuler(int MAX = 1000000) {
    lp.resize(MAX + 1, 0);
    for (long long int i = 2; i <= MAX; i++) {
      if (lp[i] == 0) {
        lp[i] = i;
        primes.push_back(i);
      }
      for (int j = 0;
           j < primes.size() && i * primes[j] <= MAX && primes[j] <= lp[i];
           ++j) {
        if (primes[j] == lp[i]) {
          lp[i * primes[j]] = primes[j];
        } else {
          lp[i * primes[j]] = primes[j];
        }
      }
    }
  }
};
long long int EulerPhi(long long int n) {
  long long int result = n;
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      result -= result / i;
    }
  }
  if (n > 1) result -= result / n;
  return result;
}
template <typename T>
vector<vector<T>> matmul(const vector<vector<T>>& a,
                         const vector<vector<T>>& b) {
  int n = a.size(), m = b[0].size(), k = b.size();
  vector<vector<T>> c(n, vector<T>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int l = 0; l < k; l++) c[i][j] += (a[i][k] * b[k][j]);
    }
  }
  return c;
}
template <typename T>
bool isPrime(T n) {
  if (n <= 1)
    return false;
  else if (n == 2 || n == 3)
    return true;
  else if (n % 2 == 0 || n % 3 == 0)
    return false;
  T x = 5;
  T p = 2;
  while (x * x <= n) {
    if (n % x == 0) return true;
    x += p;
    p = 6 - p;
  }
  return true;
}
template <typename T>
class Graph {
 public:
  struct edge {
    int from, to;
    T cost;
  };
  vector<edge> edgeList;
  vector<vector<int>> adj;
  int n;
  Graph(int _n) : n(_n) { adj.resize(n + 1); }
  void add(int from, int to) {
    adj[to].push_back(from);
    adj[from].push_back(to);
  }
  void solve(int m) {
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      cnt += (adj[i].size() == 1);
    }
    cout << setprecision(9) << 2 * ((double)m / cnt) << "\n";
  }
};
bool isSubsequenceString(string x, string y) {
  int i = 0, j = 0;
  while (i < x.length() && j < y.length()) x[i] == y[j] ? i++, j++ : i++;
  return (j == y.length());
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int testCases = 1;
  while (testCases--) {
    int n, m;
    cin >> n >> m;
    Graph<int> g(n);
    for (int i = 1; i <= n - 1; i++) {
      int u, v;
      cin >> u >> v;
      g.add(u, v);
    }
    g.solve(m);
  }
}
