#abc222e. [abc222_e]Red and Blue Tree

[abc222_e]Red and Blue Tree

给出nn个点的树和长度为mm的序列aa。现需要给每条边染成红色(red)或者蓝色(blue),要求按照aa走的路径,经过的边数红色蓝色=k红色−蓝色=k,问方案数。