#P5601. Exam Simulation: Selecting the Correct Option
Exam Simulation: Selecting the Correct Option
Exam Simulation: Selecting the Correct Option
You are given a question bank consisting of \( n \) questions. Each question is represented by its unique statement and its corresponding answer (both are non-empty strings). To test the effectiveness of memorization, a coach conducts a simulated exam with \( q \) questions. Each exam question displays 4 options, and you must select the option that exactly matches the answer from the question bank.
The input format is as follows:
- The first line contains two integers \( n \) and \( q \), where \( n \) is the number of questions in the question bank and \( q \) is the number of exam questions.
- The next \( 2n \) lines describe the question bank. Each question is given in two consecutive lines: the first line is the question statement and the second line is its answer. All question statements are unique.
- Then for each of the \( q \) exam questions, there are 5 lines: the first line is the exam question (which will match one of the question statements from the bank) and the following 4 lines are the available options.
Your task is to output, for each exam question, the 1-indexed position of the option that matches the correct answer from the question bank.
inputFormat
The first line contains two integers \( n \) and \( q \) separated by a space. \( n \) denotes the number of questions in the question bank and \( q \) denotes the number of exam questions.
This is followed by \( 2n \) lines, where each pair of lines represents a question from the question bank. The first line of the pair is the question statement and the second line is the corresponding answer.
Then for each exam question, there are 5 lines: the first line is the exam question (which can be used to lookup the correct answer), and the next 4 lines are the available options.
outputFormat
Output \( q \) lines. Each line should contain a single integer representing the 1-indexed position of the option that exactly matches the correct answer for the corresponding exam question.
sample
3 2
What is the capital of France?
Paris
What is 2+2?
4
What color is grass?
Green
What is the capital of France?
London
Paris
Berlin
Madrid
What is 2+2?
3
4
5
6
2
2
</p>