Charge strength: Link distance: Syntax N c1 x1 y1 c2 x2 y2 ... cQ xQ yQ N: number of nodes (Q: number of queries) xi, yi: 0-indexed ci = 0: unite(xi, yi) ci = 1: same(xi, yi) Format is based on AOJ DSL_1_A.