#BZOJ1906. 树上的蚂蚁

树上的蚂蚁

题目描述

输入格式

输出格式

1
3
1 2 1
2 3 1
3
1 3 2
3 1 1
1 2 3
2

f提示 N< = 100000

Source

Play with tree By Amber