AtCoder Beginner Contest 152 F - Tree and Constraints

F - Tree and Constraints 問題 $n$ 頂点の木が与えられる.この木の各辺を白か黒に塗る方法で,以下の $m$ 個の条件を全て満たすものの数を求めよ. $i$ 番目の条件は頂点 $u_i, v_i$