Reference to link
My solution is to sort the distances and arrange them in a cyclic order(except the last one). Then add edges of negative weight to minimize the sum. This yields the answer to be -1*(max_element in distances) [except when n=2]. What is wrong with my algo?
Image for test 1
Hey bro, ur algorithm misses a lot of negative edges that you can put in. Just read the editorial for the question.
Thanks. I'll try to think of it
Do you know what an editorial is and where you can find it?
yes. But I refrain from reading them
Why do you refrain from reading editorial but instead ask question on codeforces? That's like not wanting to read editorial but just asking for a different editorial from a different person instead.