시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 221 | 31 | 21 | 13.725% |
Regional Contest Director Osama Ismail knows that an individual cannot participate in the regional contest more than 5 times. Given a list of contestant names and the previous years they participated in, print which contestant is eligible.
The first line of the input contains a single integer T representing the number of the test cases
The first line of each test case contains a single integer N
N lines follow in this test case each having the format "Name Year" denoting that contestant Name participated in a regional contest in year Year
Note that since he collected the data from multiple sources it may contain duplicate records (if a contestant X have competed in year Y, you might find multiple lines "X Y" in the same test case)
For each test case, print a line containing the test case number as formatted in the sample and then for each eligible contestant print his\her name on a single line and note that you must print the names of the contestants in lexicographic order
1 6 ahmed 2010 ahmed 2011 ahmed 2009 ahmed 2008 ahmed 2005 mohamed 2001
Case #1: mohamed