#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  v.resize(n + 1);
  for (long long i = 0; i < n - 1; i++) {
    long long j, k;
    cin >> j >> k;
    v[j].push_back(k);
    v[k].push_back(j);
  }
  long long c = 0;
  for (long long i = 1; i <= n; i++) {
    if (v[i].size() == 1) {
      c++;
    }
  }
  long double ans = m;
  ans = ans / ((long double)(c));
  std::cout << std::fixed;
  std::cout << std::setprecision(20);
  cout << 2 * ans;
  return 0;
}
