3>Smallest Difference Triplet(given q explanation and soln in cpp)

Three arrays of same size are given. Find a triplet such that maximum – minimum in that triplet is minimum of all the triplets. A triplet should be selected in a way such that it should have one number from each of the three given arrays.

If there are 2 or more smallest difference triplets, then the one with the smallest sum of its elements should be displayed.
Input Format

First line contains size of the arrays.
Second line contains the elements of the first array.
Third line contains the elements of the second array.
Fourth line contains the elements of the third array.
Constraints

1 <= Size of arrays <= 100
Output Format

Print the triplet in non-increasing order.
Sample Input

7
7 5 4 3 4 3 3
3 5 5 3 6 7 6
5 7 8 8 5 10 2

Sample Output

5 5 5

Send me the name of the problem if it’s in your course. Else if it’s not from your course then send me the link for this problem.

it was asked in live codecapsuel dec contest so i can only provide u info noting else , try running only given test case

Hey @Kash-Moulik-3715574511847721 you can read this editorial to solve this problem.
Triplet minimum difference.