#include <bits/stdc++.h>
using namespace std;
long long t, n, i, j, k, x, y, z, l, r, mid, q, ans, mod = 1000000007, m, s;
long double ans1;
vector<long long> v[200005];
int main() {
  ios::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (i = 1; i <= n; i++)
    if (v[i].size() == 1) m++;
  ans1 = 2 * (s * 1.0 / m);
  cout << fixed << setprecision(12) << ans1;
}
