Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: The merchant
Description There are Input The first line contains Each of the next N-1 lines contains labels of two cities, describing a road between the two cities.The next line contains Q, the number of paths.Each of the next Q lines contains labels of two cities, describing a path. The cities are numbered from 1 to N. 1 ≤ Q ≤ 50000 Output The output contains Sample Input 4 1 5 3 2 1 3 3 2 3 4 9 1 2 1 3 1 4 2 3 2 1 2 4 3 1 3 2 3 4 Sample Output 4 2 2 0 0 0 0 2 0 Source POJ Monthly Contest – 2009.04.05, GaoYihan |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator