Logo
(追記) (追記ここまで)

9357번 - Eligibility 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB5001167319.312%

문제

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

  • T ≤ 100
  • 0 ≤ N ≤ 500
  • Name is sequence of lowercase English letters, spaces and contains up to 20 characters
  • 1970 ≤ Year ≤ 2070

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

1
6
ahmed 2010
ahmed 2011
ahmed 2009
ahmed 2008
ahmed 2005
mohamed 2001

예제 출력 1

Case #1:
mohamed

힌트

출처

ICPC > Regionals > Africa and Arab > Arab Collegiate Programming Contest > ACM Jordanian Collegiate Programming Contest > JCPC 2012 I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /