This is a poorly worded crazy question.
Until I read this in the SPOJ comments. I had no clue what the heck is largest minimum distance.
" If you are wondering why 1,4,8 instead of 1,4,9 then do not. For me its actually a subtle hint for applying binary search. You will understand it when you apply the algo.
Also if you are confused by the "minimum largest" terminology think of it as this:
if you put cows at 1,2,8. Distance btw stalls is 1, 6 resp. but if you keep at 1,4,8 distance is 3, 4. In first case minimum distance is 1 while 2nd case its 3. You can never put cows that gives a minimum that is larger than 3 i.e. distance cannot be 4,5 or 6,7 (where mins 4 and 6 > 3) so the largest minimum is 3. Just keep that in mind and Farmer John will be happy with you! ;D "