Zulu loves to play games. Once he started playing a very unusual game. The game consists of N levels where each level has two parameters
Now, the energy gained after creating a valid Magic Combo is the maximum possible energy amongst all the selected energy levels. As Zulu is very clever, he figured out that he can create many Magic Combos. Can you tell the total possible energy which can be achieved by Zulu after creating all possible Magic Combos? As the total energy value can be very high, return total energy modulus
Note that two Magic Combos are different if there is at least one level which is different among them. Energy intersection occurs between two levels if they both contain at least one common energy number.
Input:
First line contain an integer N denoting the number of levels.
Second line contains N space separated integers denoting the L array where
Last line contains N space separated integers denoting the H array where
Output:
Output in a single line the maximum energy possible modulus
Constraints:
3 1 3 10 6 8 12
24
Zulu can make 2 magic combos by using combination of level
Please login to use the editor
You need to be logged in to access the code editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor