#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int cnt = 0;
int main() {
  int node;
  scanf("%d", &node);
  ;
  long long val;
  cin >> val;
  vector<long long> v[node + 1];
  for (int i = 1; i < node; i++) {
    int a, b;
    scanf("%d", &a);
    ;
    scanf("%d", &b);
    ;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 1; i <= node; i++)
    if (v[i].size() == 1) cnt++;
  double ans = ((val * 2.0) / (cnt * 1.0));
  printf("%.15lf", ans);
}
