#include <bits/stdc++.h>
using namespace std;
int open[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, s;
  cin >> n >> s;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    open[a]++, open[b]++;
  }
  int leaf = 0;
  for (int i = 1; i <= n; i++) leaf += (open[i] == 1);
  cout.precision(15);
  cout << fixed << 2.0 * s / leaf;
  return 0;
}
