Determine the minimum integral width of the parasol heads

Assignment Help Other Subject
Reference no: EM132224560

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,

789_figure.jpg

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

705_figure1.jpg

You can find out that regardless of placement it is not possible to cover all chairs using 2 parasol 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.

Case 1 With a parasol of width 5 we are able to cover the 4 chairs using the layout

705_figure1.jpg

Case 2 With a parasol of width 6 we can cover the 10 chairs using the following layout. With any smaller width you cannot cover all the chairs.

1925_figure2.jpg

For this assignment it needs to be written in C.

Reference no: EM132224560

Questions Cloud

To minimize intergroup conflict with its suppliers : To minimize intergroup conflict with its suppliers, Starbucks does which of the following?
Members of the team of change leaders : Senior managers should be included as members of the team of change leaders because:
Marketing plan for non pesticide fruits and vegetable : What steps and criterias do we need to include in a marketing plan for non pesticide fruits and vegetable? please explain it in detail.
Brief narrative description of the baseline characteristics : Create a table and brief narrative description of baseline characteristics of the three groups that you would use at the beginning of an article Results section
Determine the minimum integral width of the parasol heads : 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
Discuss the causes of workplace violence : Compare the acquisition processes in capital goods versus services. Discuss the causes of workplace violence. Why are women often the victims?
Ethnicity-religious affiliation or political affiliation : Reflect on an experience when you interacted with someone from another nation, ethnicity, religious affiliation, or political affiliation and you detected deep,
Transactional leadership and transformational leadership : Explain the difference between transactional leadership and transformational leadership.
Why is adaptation major factor as part of change strategy : Why do organizations need strategic plans and why is adaptation a major factor as part of a change strategy?

Reviews

len2224560

1/29/2019 11:48:54 PM

Grading Information Reading from standard input/output – 10 points No output aside from the answer (e.g. no input prompts) – 10 points Reads in all the input correctly – 10 points Using a binary search over the parasol head width – 10 points Uses some method to verify a good parasol width – 10 points Your program will be tested on 10 test cases – 5 points each No points will be awarded to programs that do not compile. Solutions without a binary search will receive a maximum of 50 points Only cases that finish within the maximum of {5 times the judge solution, 10 seconds} will be graded.

len2224560

1/29/2019 11:48:48 PM

For this assignment it needs to be written in C nothing fancy, no hard coding the files, and must run in the command line. Also, run code thru valgrind. So far we have learned strings, memory, binary search, recursion and sorts.

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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