Gửi bài giải
Điểm:
20,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Tác giả:
Người đăng:
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Farmer John has built a new long barn, with N ~(2 \le N \le 10^5)~ stalls. The stalls are located along a straight line at positions ~x_1 ... x_N~ (~0 \le x_i \le 10^9~).
His C ~(2 \le C \le N)~ cows don't like this barn layout and become aggressive towards each other once put into a stall. To prevent the cows from hurting each other, FJ wants to assign the cows to the stalls, such that the minimum distance between any two of them is as large as possible. What is the largest minimum distance? Input
- Line 1: Two space-separated integers: N and C
- Lines 2: Contains an integer stall location, ~x_i~ Output For each test case output one integer: the largest minimum distance.
Example
Input:
5 3
1 2 8 4 9
Output:
3
Output details:
FJ can put his 3 cows in the stalls at positions 1, 4 and 8, resulting in a minimum distance of 3.
Bình luận
bắt e phải dùng google dịch ;))
tiếng việt đi anh, em mất gốc anh=)
chăn trâu đó
đúp anh
Bài này có rồi mà anh
tiếng việt đi a =))