|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||0||0||0||0.000%|
The Afghanistan League of Football has grown larger in the last few years. Ranking the teams in the league is a very important part of every league, and people want to understand what the current status of the league is. The league administration wants to create a website and publish the match result for public access. They need a program that can generate the data for the ranking table based on the match results. Write a program to help them with this problem.
First line contains the number of test cases (T): 0 < T < 1000
Next line contains the number of matches (M): 0 < M <= 256
Each next line contains the match result between two teams in this format:
Print the league table for each test case in the following format:
Separate each test case output with an empty line (no empty line after the last testcase result).
1 6 team1 [2 - 0] team3 team1 [1 - 1] team2 team2 [4 - 7] team3 team2 [0 - 0] team1 team3 [5 - 3] team1 team3 [6 - 1] team2
team1,5,1,2,1,6,6 team2,2,0,2,2,6,14 team3,9,3,0,1,18,10