from the root - `mcd`: Saves the distance of the maximum distant node in the
subtree for the i'th, )) ; memset(mcd,0,sizeof(mcd)) ; dp[1][0][0] = 0 ;//parent of node 1 is 0
dp[1][0][1, **Methods:** - `dfs1`: As named, does a $DFS$. AIM: To create `dp[i][0][0]`,
`dp[i][0][1]`, `mcd, - `mcd`: Saves the distance of the maximum distant node in the subtree for the
i'th node. Could be, ll dfs1(int node,int par) {// to create the depth and mcd arrays ll mcdV = 0 ;
for(auto, typedef long long ll ; #define pii pair ll depth[MAXN], mcd[MAXN]; ll
dp[MAXN][20][2







