#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, s, i;
  cin >> n >> s;
  vector<long long> v[n + 1];
  for (i = 0; i < n - 1; i++) {
    long long temp1, temp2;
    cin >> temp1 >> temp2;
    v[temp1].push_back(temp2);
    v[temp2].push_back(temp1);
  }
  double count = 0.0;
  for (i = 1; i <= n; i++) {
    if (v[i].size() == 1) {
      count++;
    }
  }
  cout << fixed << setprecision(20) << 2 * s / count;
  return 0;
}
