Math, asked by priyaksrSophia7326, 9 months ago

The second line contains n integer numbers separated by a single space representing current points of participants. Points are sorted in non-increasing order. The third line contains n integer numbers separated by a single space, representing point awards for the next race. Points are sorted in non-increasing order, so the winner of the race gets the maximum number of points.

Answers

Answered by ritikraj200490
0

Answer:

Step-by-step explanation:

The first line contains two integer numbers N (1≤N≤200000) representing number of F1 astronauts, and current position of astronaut D (1≤D≤N) you want to calculate best ranking for (no other competitor will have the same number of points before the race).

The second line contains N integer numbers Sk (0≤Sk≤108, k=1...N), separated by a single space, representing current ranking of astronauts. Points are sorted in non-increasing order.

The third line contains N integer numbers Pk (0≤Pk≤108, k=1...N), separated by a single space, representing point awards for the next race. Points are sorted in non-increasing order, so winner of the race gets the maximum number of points.

Output

Output contains one integer number — the best possible ranking for astronaut after the race. If multiple astronauts have the same score after the race, they all share the best ranking.

Similar questions