P4878 [USACO05DEC] Layout G

Background

14组数据,前10组为原数据,后4组为hack数据

Description

Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2

Input Format

N/A

Output Format

N/A

Explanation/Hint

Explanation of the sample: There are 4 cows. Cows #1 and #3 must be no more than 10 units apart, cows #2 and #4 must be no more than 20 units apart, and cows #2 and #3 dislike each other and must be no fewer than 3 units apart. The best layout, in terms of coordinates on a number line, is to put cow #1 at 0, cow #2 at 7, cow #3 at 10, and cow #4 at 27.