#D4. Swiss system
Swiss system
Background
In competitive matches such as table tennis, badminton, and chess, the most common format is knockout and round robin. The characteristic of the former is that there are fewer matches, each one is tense and exciting, but the randomness is higher. The latter is characterized by fairness and low chance, but the competition process is often very lengthy. The Swiss round robin system introduced in this question is named after the first chess tournament held in Switzerland in . It can be seen as a compromise between elimination and round robin matches, ensuring the stability of the competition while keeping the schedule from being too long.
Description
contestants numbered will participate in the R round of the competition. Before the start of each round of competition and after all competitions, the contestants will be ranked in descending order of their total score. The total score of the contestants is the initial score before the start of the first round plus the scores of all the competitions they have participated in. If the total score is the same, the player with the smaller designated number will be ranked higher. The arrangement of each round of matches is related to the ranking before the start of the round: and , and ,..., and ,..., and , each with one match. The winner of each game gets point, and the loser gets points. That is to say, except for the first round, the arrangement of other rounds of matches cannot be determined in advance, but depends on the performance of the players in previous matches.
Given the initial score and strength value of each player, calculate the number of the player ranked -th after the -round competition. We assume that the strength values of the contestants are different from each other, and the one with higher strength values always wins in each game.
Format
Input
The first line of input consists of three positive integers , , and , separated by a space between each two numbers, indicating that there are players, round matches, and the ranking that we are concerned about. The second line consists of non negative integers , ,..., , separated by a space between each two numbers, where represents the initial score of the player with the number . The third line consists of positive integers , ,..., , separated by a space between each two numbers, where represents the strength value of the player with the number .
Output
The output consists of only one line containing an integer, which is the number of the player ranked -th after the end of the -round competition.
Samples
input1
2 4 2
7 6 6 7
10 5 20 15
output1
1
data range
For of the data, ; For of the data, ; For of the data, ,,,,。