#P15263. [USACO26JAN2] Circle of Cows P
[USACO26JAN2] Circle of Cows P
Description
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
The first line contains and .
The second line contains .
Output Format
Output a single line with space-separated integers, with the answers for in that order.
4 100
0 25 50 75
50 50
4 100
0 1 2 99
3 2
Hint
Sample 1 Explanation
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 2 Explanation
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.
京公网安备 11011102002149号