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

  What are the notable achievements of the group

What are the significant events in the groups history. Has this group been discriminated against.

  How might the theories of self-efficacy support the approach

The attached is a message posted by Jamie, a "student" in an online introductory psychology class (the instructor has not heard from her previously on this issue). How might one respond to Jamie in order to improve her level of self-efficacy

  Conduct a review from professional literature-articles

Conduct a review from professional literature-articles from peer-reviewed journals and relevant textbooks-on the factors influencing self-image during middle.

  Explain the different types of communication

Create three hypothetical (fake) scenarios of problems that adolescents might encounter, including an issue that involves culture or ethnic issues. Show who adolescents could use improved communication skills to solve these problems;

  To research and describe a new technology

Purpose: To research and describe a new technology and hypothesis where it may be used in the future

  Making list relative level of control of project

Make a list (each should have at least two but no more than five) of the stakeholders for each and their relative level of control of the project.

  What factors must be considered in maximizing productivity

In this week's discussion, answer the following questions... What is motivation? What factors must be considered in maximizing productivity? What are the various theories of motivation?

  Role in financing personal health services

How does the federal government’s role in financing personal health services compare with its role in financing public health services? What reasons may explain any similarities or differences in these roles? What reasons may explain any changes in t..

  Best reform ever happened in judaism

"Gender neutrality was the best reform ever happened in Judaism"

  What are major determinants of health

What are major determinants of health? What constitutes health and well-being in one society may be quite different in another society.

  How do the relationships affect workplace communication

Did you notice the influence of power in the communication? Classify the communication as effective or ineffective and support your rationale.

  Prepare poster that describes how efforts of public agency

Prepare an A3 poster that describes how the efforts of one public, private, not-for profit agency, or faith based group and you as a professional

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