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

  Create an example of a research design

Create an example of a research design that would call for a repeated measures ANOVA.Reflect on what you think is the biggest limitation to your research.

  What is the relationship between prejudice and stereotypes

Ethnocentrism is related to prejudice (2010). What is the relationship between prejudice and stereotypes?

  Criminal behavioral research

A brief description of one ethical principle and one research standard that you think apply to conducting research in criminal behavior. Then, explain how each applies, using specific examples.

  Discuss differences in competencies between nurses prepared

Discuss the differences in competencies between nurses prepared at the associate-degree level versus the baccalaureate-degree level.

  How is virtual classroom similar to traditional classroom

How is the virtual classroom similar to the traditional classroom? What is the benefit of combining web-based training with classroom training?

  Situation at fort sumter

President Lincoln's decision on what to do about the situation at Fort Sumter in the first weeks of his administration can best be characterized as

  Explore your experiences using resources

Explore your experiences using resources, including concerns encountered when conducting academic research through the Ashford University Library.

  Compare and contrast the religious contributions of

q 1. compare and contrast the lives of muhammad saladin and ousman regarding their use of the military treatment of

  Biological naturalism dualistic

Is John Searle’s “Biological Naturalism” dualistic? Why or why not? What procedural changes should be added -- if any -- to the medical standard of care in light of research on placebo effects? If you do not believe there should be any, state why.

  Identify the literary production you chose to focus on

Identify the literary production you chose to focus on. Provide a brief overview of what the piece is about, the author's background

  Defense strategy is used preserve security

The defense strategy is used to preserve security. Identify and decribe what assumptions are made about the opponent according to this stategy

  Who is the current president of gallaudet

What are your thoughts on the 2nd protest? Are your thoughts the same or different toward this protest compared with the 1st protest? Be sure to give details and thoroughly explain your reasoning - your response should be substantial.

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