Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 4 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 16 Sep 2017 My Price 8.00

minimum distance

Gagan likes to teach his juniors. One day he was teaching and getting very disturbed by the continuous talking of the students in the first row. He thought a way to make them quiet by seperating them.He wants the students to sit on benches such that the minimum distance between any two benches be as large as possible.He is having one problem that some of the benches in between are broken so no one can sit on it.
He wants you to help her out.

Note: He gets distracted by only first row students.

Input

  • The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
  • The first line of each test case contains two space-separated integers:
    N S , denoting the number of benches available and number of students in first row respectively. The second line contains N space-separated integers A1, A2, ..., AN denoting the index of benches.

Output

Print the largest minimum distance between any two benches.

Constraints

  • 1 = T = 600
  • 1 = N =S=10^5
  • 1 = Ai = 10^7

 

Example

Input: 2 5 2 1 5 3 7 11 7 3 3 9 6 11 15 20 23 Output: 10 8

 

Explanation

Example case 1.Two students are made to sit on 1st and 11th bench.Therefore largest minimum distance is 10.

Answers

(5)
Status NEW Posted 16 Sep 2017 01:09 PM My Price 8.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)