#include<iostream>
#include<bits/stdc++.h>
using namespace std;
const int maxn = 100+5;
int father[maxn],deep[maxn],width[maxn];
int n,maxd = 1,maxw = 0;
int lca(int u,int v){
if(deep[u] < deep[v])
swap(u,v);
while(deep[u] != deep[v]){//深度相同
u = father[u];
}
if(u == v)return v;//如果v是u的祖先,返回v
while(father[u]!=father[v]){//否则找u和v的公共祖先
u = father[u];
v = father[v];
}
return father[u];
}
int main(){
int u,v;
cin >> n;
deep[1] = 1;
width[1] = 1;
for(int i = 1; i < n; ++i){
cin >> u >> v;
father[v] = u;
deep[v] = deep[u]+1;
width[deep[v]]++;
if(maxd < deep[v])maxd = deep[v];
}
for(int i = 1; i <= maxd; ++i)
if(maxw<width[i])maxw = width[i];
cout << maxd << endl << maxw << endl;
cin >> u >> v;
cout << (deep[u] - deep[lca(u,v)])*2+deep[v]-deep[(lca(u,v))];
return 0;
}
02-25
7103

11-25
317

10-21
5130

07-22
1万+

05-15
11-03