You are given equations like A/B=k and queries like A/B, C/D. Evaluate each query or return -1 if unknown.
Weighted Graph BFS
Build graph where each A→B edge has weight k and B→A has weight 1/k. BFS from source to target, multiplying edge weights.