India’s Best Job Seekers and Training Platform Forums Data Structure There is an island surrounded by oil mines. You will be given n companies…

  • There is an island surrounded by oil mines. You will be given n companies…

     Akash  updated 10 months, 2 weeks ago 1 Member · 1 Post
  • Akash 

    Administrator
    at

    There is an island surrounded by oil mines. You will be given n companies and m oil mines having values. You have to distribute the mines to “n” companies in fair manner. Remember the companies can have oil mines adjacent to each other and not in between of each others.After distributing them compute the differnce of oil mines from the company getting highest and company getting lowest. This number should be minimum.(then only the distribution can be termed as fair).

    Example

    Input

    2

    2 4

    6 13 10 2

    2 4

    6 10 13 2

    output

    5

    1

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
KodNest Training New Batch is starting on 21st September 2020. Attend one week free demo classes.Register Now

New Report

Close