#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, s;
int num[N];
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> s;
  s *= 2;
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    num[u]++, num[v]++;
    if (num[u] == 1)
      cnt++;
    else if (num[u] == 2)
      cnt--;
    if (num[v] == 1)
      cnt++;
    else if (num[v] == 2)
      cnt--;
  }
  double ans = (double)(s) / (double)(cnt);
  cout.precision(20);
  cout << fixed;
  cout << ans;
  return 0;
}
