LCC '24 Contest 2 S1 - Betting Odds
View as PDFThere are  contestants remaining, each with a unique cyan jersey numbered with 
 
. The contestants are ordered in single file from least to greatest number 
.
In front of the first contestant is a glass bridge that may break as they cross.
As a rich VIP, you've bet on  
 players each with numbers 
 
. For each of your contestants, you'd like to know how many people are in front of them in the line in order to gauge how likely they are to survive.
Input Specification
The first line of input contains two integers,  and 
, the number of contestants and the number of contestants you're betting on respectively.
The next  lines of input each contain a number 
, the numbers on each contestant's jersey, sorted from least to greatest.
The next  lines of input each contain a number 
, the numbers of each contestant's jersey that you're betting on.
Output Specification
Output  lines, each line containing the number of contestants ahead of contestant 
 in the order that they were inputted.
If the contestant  doesn't exist, output 
-1
Constraints
Subtask 1
Subtask 2
Sample Input 1
5 3
3
7
15
24
33
15
8
7Sample Output 1
2
-1
1
Comments