Four Arrays CodeChef Solution | CodeChef Problem Solution 2022
You have been given an integer and four arrays , , , and with sizes , , and respectively.
Follow the given steps:
- Pick four indices , , , and from arrays , , , and respectively. Note that , , and .
- There are in total ways to do the above step. For each way, write down the value of on a board.
- Sort all the numbers written on the board in non-decreasing order.
Solution Click Below:- CLICK HERE
Find the element written on the board.
Input Format
- First line contains five integers , , , and .
- The second line contains space-separated integers denoting the array .
- The third line contains space-separated integers denoting the array .
- The fourth line contains space-separated integers denoting the array .
- The fifth line contains space-separated integers denoting the array .
Output Format
For each test case, output the required number in a single line .
Constraints
Sample Input 1
2 1 3 2 10
2 3
2
1 1 2
3 1
Sample Output 1
20
Explanation
After sorting the numbers on the board are in the following order . So, the number is .
Join Now for Solution:-
No comments:
Post a Comment