Description Input Output Sample Input1 3 1 2 1 2 3 1 3 1 3 2 3 1 1 1 2 3Sample Output2HintN< = 100000SourcePlay with tree By Amber