Zonal Computing Olympiad is round 1 out of 3 (i.e. beginner) for selection into Indian IOI team.
N knights are sitting in a circle. Making a dessert for knight i costs C[i]. Find the minimum cost such that for every pair of adjacent knights, at least one gets his dessert. N ≤ 10 ** 6.
Check out the replies for hints.