#5412. Problem 1. Circle of Cows
Problem 1. Circle of Cows
Problem 1. Circle of Cows
USACO 2026 Second Contest, Platinum
Farmer John has () cows at distinct locations along a circle of circumference ().
FJ will select pairs of cows, where , and no cow is selected more than once. He wants to select the pairs such that the minimum distance between any two cows in the same pair along the circumference of the circle is maximized.
For each value of , help FJ determine the maximum possible minimum distance.
INPUT FORMAT (input arrives from the terminal / stdin):
The first line contains and .
The second line contains .
OUTPUT FORMAT (print output to the terminal / stdout):
Output a single line with space-separated integers, with the answers for in that order.
SAMPLE INPUT:
4 100 0 25 50 75
SAMPLE OUTPUT:
50 50
For , cow 1 can be paired to cow 3, which is distance away along the circumference of the circle, making the answer .
For , cow 1 can be paired to cow 3, and cow 2 can be paired to cow 4, which is distance away from it along the circumference of the circle, making the answer still .
SAMPLE INPUT:
4 100 0 1 2 99
SAMPLE OUTPUT:
3 2
For , cow 3 can be paired to cow 4, which is distance away from it along the circumference of the circle, making the answer .
For , cow 1 can be paired to cow 3 and cow 2 can be paired to cow 4. Each of these pairs contains two cows at a distance of from each other along the circumference of the circle, making the answer .
SCORING: Inputs 3-4: Inputs 5-6: Inputs 7-14: Inputs 15-22: No additional constraints.
Problem credits: Benjamin Qi