AGGRESSIVE COWS
💥 Proposal
Not part of Contributor's Hack 2020
Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 <= xi <= 1,000,000,000).
His C (2 <= C <= 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 Format First line contains N and C, separated by a single space, representing the total number of stalls and number of cows respectively. The next line contains N integers containing the indexes of stalls. Output Format Print one integer: the largest minimum distance.
example::
Sample Input 5 3 1 2 8 4 9 Sample Output 3 Problem Credits - (Spoj)[http://www.spoj.com/problems/AGGRCOW/]
Have you read the Contributing Guidelines on Pull Requests?
yes
Assignees
CPP: [@NEEHITGOYAL ] C: [@SangeetaMishra ] C#: Java: [@ritvij14 ] Python: Go: Javascript:
i would like to work on this issue in c++ as part of hakin codes @SKAUL05 @Abhijit2505 @plazzy99 @Kajol-Kumari
I would like to take this in Java for CH20.
The name of the problem LOL @NEEHITGOYAL Go ahead with C++ @SangeetaMishra Go ahead with C @ritvij14 Go ahead with Java
I would like to work on this in python
will there be only one test case or multiple test cases such as
5 3 1 2 4 8 9
6 3 1 6 7 8 9 21
can i solve it in python/java
@coolpydev I HAVE MADE ISSUE FOR SINGLE TEST CASE YOU MAY MAKE ANOTHER ISSUE IF U WANNA ADD MULTIPLE TEST CASES
This issue is not the part of Contributor's Hack 2020
Reason: As this is a Problem set Question, not any Algorithm or Data Structure Implementation, we cannot add this issue as part of Hakincodes 2020
@siddharth25pandey what is the folder cp for and also the folder others many issues as a problem statement were issues has been added as part of hakin codes kindly add it as part of hakin codes it is a good prob. for understanding binary search
@NEEHITGOYAL There are plenty of Questions in CP which needs implementation of DS & Algo, which doesn't mean we can add each of them.
- Conclusion This issue cannot be added as part of CH20 due to this reason. Instead of discussing here, better to search for other issues, Thanks!
@NEEHITGOYAL can you assign me to complete this program in python. I've the repository ready in my profile for multiple inputs as it was in SPOJ.
@coolpydev I m not mentor
Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Telegram or ping one of the reviewers. Thank you for your contributions!