Water scarcity is a major problem for Graph city. Graph city has N nodes and N - 1 edges and there is a path between every pair of nodes. Now between every pair of cities that are connected there is a pipe with capacity C.
People of Graph city wanted to test the water usage. Their metric was as follows:
Given a set of cities find the pairwise sum of flows between each pair of cities in the given set. You need to answer the above query for every test set given to you.
Flow between two cities is defined as pumping water at infinite rate from one of the selected city and measuring at how much rate water comes at the other city.
All Nodes are 1 indexed.
Input