Professor Lee's Exam
Time limit1sMemory limit256 MB
Print the numbers of students whose ten answers exactly match 1, 2, 3, 4, 5, 1, 2, 3, 4, 5 in order.
- Level
Easy1 of 10
- Topics
- Implementation, Array
- Solved
- No attempts yet
Problem
Professor Lee teaches at UCPC. His final exam is multiple choice and has ten questions. For each question a student picks the one option, out of five, that comes closest to the answer. The questions are hard, so almost nobody gets a perfect score.
This semester the correct answers followed a rule. The answer to question is option , where is the remainder operation. For question 1 the answer is , option 1, and for question 8 it is , option 3. Questions are numbered 1 to 10 and options are numbered 1 to 5.
Many students noticed the rule during the exam. They solved the easy questions at the front, worked out the formula, and then answered the hard questions at the back without solving them. Professor Lee treats that as cheating, so every student with a perfect score has to sit a new exam. The answers of the new exam follow no rule.
You are given the answer sheets of students. Write a program that finds the list of students who have to sit the new exam.
Input
The first line contains the number of students who took the exam. ()
Each of the next lines contains ten integers between 1 and 5, separated by spaces. The -th number on the -th line is the option that student chose for question . (, )
Output
Print the numbers of the students who have to sit the new exam in increasing order, one per line.
If no student has to sit it, print nothing.