Determine the minimum integral width of the parasol

Assignment Help Other Subject
Reference no: EM132199768

For this assignment it needs to be written in C nothing fancy, no hard coding the files, and must run in the command line.

Parasols
As per usual ARC is working on expanding the outside eating location outside the Student Union. They have set up chairs on a linear path that extends quite far. To prevent the engineering students from constructing towers from the chairs the SGA has supplied chairs that are bolted to the ground and can no longer be moved. The only issue is that the sun is overbearing and the rain can ruin the outside lunches during the summer.

ARC bought k parasol stands to help cover the outside seating. However, ARC has not purchased any parasol tops nor has determined where to place the parasols. ARC has hired you to help protect their students from the weather. They want to buy k identical parasol tops to cover all the seating. Each chair should be completely covered by at least one parasol. UCF does not want to spend too much money, so you will help determine the minimum integral width of the parasol heads such that all the chairs can be covered.

Suppose you have 2 parasols stands, and 4 chairs at positions 1, 4, 7, and 11. We could cover all the chairs with parasol widths of 6. See the following diagram,

1000_figure1.jpg

However, we could also cover all the chairs with parasol widths of 5. See the following diagram

1000_figure1.jpg

you can find out that regardless of placement is not possible to cover all chairs using 2 parasols with widths less than 5.

Input Specification

The first line of input contains a two positive integers, n and k, (n, k ≤ 200,000) representing the number of chairs and the number of parasol stands. The following line will contain n positive, space separated integers representing the position of the chairs in meters from the student union. Note that each chair's position will be given in increasing order.

Output Specification
You will output a single positive integer representing the minimum width of the parasols such that each chair will be completely covered by at least on parasol.

Attachment:- sample_assignment.rar

Reference no: EM132199768

Questions Cloud

Which group of investors is considering forming corporation : Come up with a hypothetical story in which a group of investors is considering forming a corporation.
Illustrates both the common law of contracts : Come up with a hypothetical scenario that illustrates both the common law of contracts, as well as sales agreements under the UCC.
Three important considerations for hospitality organizations : Discuss three important considerations for hospitality organizations to make with regard to overcome or prevent resistance to organizational change.
Describe how free cash flow should be estimated : Overall company value normally is estimated using the Free Cash Flow approach. Describe how Free Cash Flow should be estimated
Determine the minimum integral width of the parasol : Determine the minimum integral width of the parasol heads such that all the chairs can be covered - it needs to be written in C nothing fancy
Address key organizational behavior challenges : Share what recommendations you have for the organization to address key organizational behavior challenges and any resistance to change.
What is the expected return and standard deviation : A pension fund manager is considering three mutual funds. What is the expected return and standard deviation of the optimal risky portfolio
Explain the five factors of communication in detail : Explain the five factors of communication in detail. A firm that wants decisions to be made by managers who are closer to the issue at hand should choose.
Information about the chance of being successful : You are contemplating making one of 3 investments, A, B, or C. Here is some information about the chance of each being successful:

Reviews

Write a Review

Other Subject Questions & Answers

  Why is it important to overcome communication barriers

Why is it important to overcome communication barriers. What is one strategy that you can use to prevent conflict in the work place

  Analyzes the story of ivan illych in terms of concepts

Write a 750-1,000 word paper that analyzes the story of Ivan Illych in terms of concepts of the "healing environment".

  Discus family must aware of in regards to medication

Discuss what the family member will need to be aware of in regards to this medication, and how they can best keep their infant or child safe

  Community health promotion methods

HPR232: What competencies/sub-competencies do you already understand and which ones are new to you - Which ones do you think will be the hardest to learn and perform?

  How analysis opens up or expands your understanding

For this week, please read the following music video analysis and write a response to it - in your response, discuss how it opens up or expands.

  Does the organization use health information technology

Which outcomes related to quality are currently being monitored in the organization that you have selected? How is related data collected and evaluated?

  What do you think of the five love languages

What do you think of the five "love languages?" Have you ever taken the Five Love Language quiz? If you have taken the quiz, what were your results (e.g. what was your Love Language)

  Explain two limitation of the metaphor of the psychic prison

Explain two limitations of the metaphor of the psychic prison. Provide a minimum of four academic resources in APA style to support your work.

  Explain the connection between each theoretical orientation

Explain the connection between each theoretical orientation used by Dr. Remoc and the four interventions utilized in the case

  Consider the anecdote of elena in your text book obviously

consider the anecdote of elena in your text book. obviously elenas mother prefers that her daughter participates in

  Where do serial killers hunt

Where do serial killers hunt? Where are the killing fields? Discuss the trends/traits of the victims.

  Example of supporting plan that is driven by strategic plan

An example of a supporting plan that is driven by the strategic plan is?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd