#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(16);
  int n, s;
  cin >> n >> s;
  vector<int> d(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    d[a]++;
    d[b]++;
  }
  int cnt = 0;
  for (int i : d) cnt += i == 1;
  cout << (double)s * 2 / cnt << endl;
  return 0;
}
