func_code_string: #include <bits/stdc++.h>   using namespace std;   stack<int> S;   int n, m, q, x, y;   struct rs_tree {     int hed[200005], ver[600005], nxt[600005], tot, cnt;     int dep[200005], fa[200005], top[200005], siz[200005], son[200005];     void push(int x, int y) {       ver[++tot] = y;       nxt[tot] = hed[x];       hed[x] = tot;     }     void dfs1(int now, int en) {       dep[now] = dep[en] + 1;       fa[now] = en;       for (int i = hed[now]; i; i = nxt[i]) {         if (ver[i] == en) continue;         dfs1(ver[i], now);         if (son[now] == 0 || siz[son[now]] < siz[ver[i]]) son[now] = ver[i];         siz[now] += siz[ver[i]];       }       return;     }     void dfs2(int now, int TOP) {       top[now] = TOP;       if (son[now]) dfs2(son[now], TOP);       for (int i = hed[now]; i; i = nxt[i]) {         if (ver[i] == fa[now] || ver[i] == son[now]) continue;         dfs2(ver[i], ver[i]);       }       return;     }     int find_lca(int x, int y) {       int sum = dep[x] + dep[y];       while (top[x] != top[y]) {         if (dep[top[x]] < dep[top[y]]) swap(x, y);         x = fa[top[x]];       }       if (dep[x] > dep[y]) swap(x, y);       sum -= (2 * dep[x] - 1);       return sum >> 1;     }   } RST;   struct graph {     int hed[100005], ver[1000005], nxt[1000005], tot;     int dfn[100005], low[100005], num, cnt, vis[100005];     void push(int x, int y) {       ver[++tot] = y;       nxt[tot] = hed[x];       hed[x] = tot;     }     void dfs(int now, int en) {       S.push(now);       dfn[now] = low[now] = ++cnt;       vis[now] = 1;       for (int i = hed[now]; i; i = nxt[i]) {         if (!dfn[ver[i]]) {           dfs(ver[i], now);           low[now] = min(low[now], low[ver[i]]);           if (low[ver[i]] >= dfn[now]) {             num++;             int z;             do {               z = S.top();               S.pop();               RST.push(z, num);               RST.push(num, z);               vis[z] = 0;             } while (z != ver[i]);             RST.push(now, num);             RST.push(num, now);           }         } else if (vis[ver[i]])           low[now] = min(low[now], dfn[ver[i]]);       }     }     void tarjan() {       num = n;       cnt = 0;       dfs(1, 0);     }   } G;   int main() {     scanf( %d%d%d , &n, &m, &q);     for (int i = 1; i <= m; i++) {       scanf( %d%d , &x, &y);       G.push(x, y);       G.push(y, x);     }     G.tarjan();     RST.dfs1(1, 0);     RST.dfs2(1, 1);     for (int i = 1; i <= q; i++) {       scanf( %d%d , &x, &y);       printf( %d n , RST.find_lca(x, y));     }     return 0;   }   