Problem J. How far away ?
时间限制 1000 ms
内存限制 32 MB
There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house B"? Usually it hard to answer. But luckily int this village the answer is always unique, since the roads are built in the way that there is a unique simple path("simple" means you can't visit a place twice) between every two houses. Yout task is to answer all these curious people.
输入数据
输出数据
For each test case,output m lines. Each line represents the answer of the query. Output a bland line after each test case.
样例输入
复制
2
3 2
1 2 10
3 1 15
1 2
2 3
2 2
1 2 100
1 2
2 1
样例输出
$ Mathjax font initiator $