Question
Given a list of n players, select a team with maximum score and no conflicts. Conflicts arise when a younger player has more score than elder player.
Input format
n
age2 age2 . . . agen
score2 score2 . . . scoren
Sample Input 0
5
7010 7020 7015 7025 7005
95 90 89 96 80Sample Output 0
355Explaination
Output should be 90 + 89 + 96 + 80 (players 2, 3, 4, 5) as they don't have conflict among them (between any 2 player among them) but someone in the team has conflict with the 1st player.