|
||||||||||
2006Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1112 Accepted Submission(s): 332 Problem Description When the old year is leaving and the New Year is coming, people are always looking back over the past while looking forward to the future. "What do you think is the most important events in the past year 2006?", a friend asked me. "Well, maybe the World Cup.", I replied. "Yeah, do you know, in a football match, how to arrange a proper match table for a group?" "That's easy. In the World Cup, there are only 4 teams in a group. Everyone knows how to do it." "Yes, it's easy for four-team¡¯s arrangement. But if there are six teams or more games, can you arrange that?" "OK, let me have a try". I answered. In fact, I tried many times to solve the problem, but got failure in the end. Can you help me? Input The input contains data for several test cases. Each case contains a single even integer, which is less than 2007, indicate the number of teams in a group. and n-1 lines followed, indicate the match table.each line indicate one round in the contest.For example, 4 1-2 3-4 // the first round 1-3 2-4 // the second round 1-4 2-3 // the third round Output For each test case output "Yes" means the match table is correct, or "No" otherwise. Sample Input
Sample Output
Author xuezaiyue Source | ||||||||||
|