Determine the minimum integral width of the parasol heads

Assignment Help C/C++ Programming
Reference no: EM132118223

Assignment -

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.

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,

223_figure.png

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:- Assignment File.rar

Reference no: EM132118223

Questions Cloud

Firm should have precise protocol : Ideally, before a new product is developed, a firm should have a precise protocol, which includes which of the following?
What neurotransmitter drug would be helpful : As a student "intern" based on your understanding of the material, how would you explain how both genetics and her environment play a factor in her behaviors.
Provides employees with motivation and strategic direction : Find the mission statement tell us whether or not do you think the statement is constructive and provides employees with motivation and strategic direction.
Calculate the process capability index for this example : Calculate the process capability index for this example.
Determine the minimum integral width of the parasol heads : UCF does not want to spend too much money, so you will help determine the minimum integral width of the parasol heads
What are some things needed to socially change : Choose a demographic and list some of the prejudices, biases, stereotypes, and discrimination that group may face either at work, community.
Visually demonstrated through the use of organization : Corporate structures showing the relationships among people are visually demonstrated through the use of an organization
How did michael help the family become closer : What are some challenges Michael experienced when he 1st arrived at his new school (identify all: personally, academically, and socially)?
You understand how to better support customers you face : Knowing what you have experienced as a customer will help you understand how to better support customers you face.

Reviews

len2118223

9/20/2018 10:37:27 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.

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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