#include <bits/stdc++.h>
using namespace std;
set<int> s;
vector<vector<int> > v;
bool ch[100005];
void go(int i) {
  ch[i] = true;
  int z = 0;
  for (auto it : v[i]) {
    if (ch[it] == false) {
      z++;
      go(it);
    }
  }
  if (z == 0) {
    s.insert(i);
  }
}
void dynamic() {
  int n;
  cin >> n;
  long double sum = 0;
  cin >> sum;
  v.resize(n + 1);
  memset(ch, 0, sizeof(ch));
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  go(1);
  int z = s.size();
  if (v[1].size() == 1) {
    z++;
  }
  sum = sum / z;
  sum *= 2;
  cout << setprecision(12) << sum << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    dynamic();
  }
}
