Need help in solving this problem

Chef likes to play with graphs a lot. Today he created a graph in the following way. He first lays down N nodes in a circle. The nodes nodes are numbered from 1 to N , in the clockwise order, i.e. the node 2 is followed by 1, 3 is followed by 2, and 1 is followed by N . There is an edge between each adjacent pair of vertices, so there are total N such edges. Each edge has an integer associated with it (may be negative).

we will be given start and end then we have to find minimum cost for going from start to end


This is the editorial
Pls Like :slightly_smiling_face: