Federal Voting Age | 프로그래밍의 벗 PivotOJ
PivotOJ

Federal Voting Age

시간 제한: 1000ms메모리 제한: 128MB출처: CCC 2007 SeniorBOJ 6845

문제

For the big election on February 27, 2007, the government has commissioned an electronic voting system, and you have been hired as a sub-subcontractor for this very grand programming project.

Your task is to write the system that determines whether a given person is old enough to vote. The voting age is 18, so given someone’s birthday, you must determine whether that person will be 18 years of age on the day of the election.

입력

The input will consist of a number n (1 ≤ n ≤ 100) on a single line, indicating the number of birthdays to evaluate. Then, each of the following n lines, will be of the form y m d, where y is the year of a potential voter’s birth (0 ≤ y ≤ 2007), m (1 ≤ m ≤ 12) is the month of birth, and d (1 ≤ d ≤ 31) is the day. It is assured that each birthday is a correct and valid date.

출력

For each date in the input, output a line with either “Yes” if the voter is eligible to vote, or “No” otherwise.

예제

예제 1

입력
5
1933 10 29
1989 2 28
1961 11 23
1999 12 31
1989 2 27
출력
Yes
No
Yes
No
Yes
코드를 제출하려면 로그인하세요.