#include using namespace std; typedef long long ll; int main() { int N, K; cin >> N >> K; vector adj[N]; for (int i = 0; i < N - 1; i++) { int a, b; cin >> a >> b; adj[a - 1].push_back(b - 1); adj[b - 1].push_back(a - 1); } deque q; q.push_back(0); int cnt = 0; bool vis[N]{}; vis[0] = true; while (!q.empty()) { int v = q.front(); q.pop_front(); for (int u : adj[v]) { if (vis[u]) continue; vis[u] = true; cnt++; q.push_back(u); } } cout << cnt << "\n"; if (cnt >= K - 1) { cout << K - 1 << "\n"; } else { cout << "-1\n"; } return 0; }