DescriptionInputOutputSample Input3 3 4 5 4 1 3 3 5 3 117 170 197 3 210 229 247 3 185 185 222 4 5 45 89 113 4 13 52 53 68 0 Sample Output6 6 9900 22344 16428 1980 1800 Hint3<=N<=6 1<=Ri<=300Source2010福建集训