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