The background knowledge of this problem comes from "Similarity of necklaces". Do not worry. I will bring you all the information you need.
The little cat thinks about the problem he met again, and turns that problem into a fair new one, by putting N * (N + 1) / 2 elements into a linear list, with M = N * (N + 1) / 2 elements:
(The above table denotes Table and Pairs in description of
after converting)
One more array named "Multi" appears here. Suppose Pairs and Multi are given, the little cat's purpose is to determine an array Table with M integers that obey:
(this condition is similar with the condition
that appears in the problem "Similarity of necklaces") and make
as large as possible. What is more, we must have Low[i] <= Table[i] <= Up[i] for any 1 <= i <= M. Here Low and Up are two more arrays with M integers given to you.