You need to answer distance queries between pairs of nodes in a tree. The distance is the number of edges on the path connecting them. The formula:
dist(u, v) = depth[u] + depth[v] - 2 * depth[lca(u, v)]
Preprocess the tree with binary lifting to answer LCA queries in time, then compute distances using the formula. Try implementing this yourself. You already know binary lifting from the previous section.