#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adjlist;
int main() {
  int n, s;
  cin >> n >> s;
  adjlist.assign(n + 1, vector<int>());
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adjlist[a].push_back(b);
    adjlist[b].push_back(a);
  }
  long double coun = 0;
  for (int i = 1; i <= n; i++) {
    if (adjlist[i].size() == 1) coun++;
  }
  long double yo = 2 * s;
  yo /= coun;
  cout << fixed << setprecision(20) << yo;
  return 0;
}
