subject

The Acme Fireworks Company conducts its shows using a custom-designed firing line with multiple launchers. When multiple shells are fired simultaneously, Acme uses launchers that are spread out as far as possible. For example, when two shells are fired simultaneously, Acme uses the leftmost and rightmost launchers. When three shells are fired, it uses the leftmost launcher, the rightmost launcher, and the launcher that is closest to the center.

Things get complicated as the number of simultaneously fired shells increases. Acme’s goal is always to make the smallest of the separations between adjacent launchers as large as possible. For example, below is one of Acme’s firing lines. The launchers are labeled 0L0 through 6L6, and the distance in meters between each pair of launchers is given.

When three shells are fired, launchers 0L0, 3L3 and 6L6 are used. Stations 0L0 and 3L3 are separated by nine meters while stations 3L3 and 6L6 are separated by eight. The smallest separation is eight meters, and since there’s no approach that yields a smallest separation that is higher than eight, the solution is optimal.

Now suppose five shells are fired. The optimal smallest separation of four meters is obtained by using launchers 0L0, 2L2, 3L3, 4L4 and 6L6.

Input

The first line contains the number n of launchers and the number k of scenarios to consider, where 1≤≤10000001≤n≤1000000 and 1≤≤1001≤k≤100. The next −1n−1 lines contain the distances between launchers, with line i containing the separation between −1Li−1 and Li. The sum of the separations is never larger than 109109. Each of the remaining k lines describes a scenario by giving the number of shells to fire, where 2≤≤2≤s≤n for each scenario s.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:00
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
question
Computers and Technology, 23.06.2019 23:00
Computer programming is one type of what career
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
You know the right answer?
The Acme Fireworks Company conducts its shows using a custom-designed firing line with multiple laun...
Questions
question
Mathematics, 05.05.2020 11:01
question
Mathematics, 05.05.2020 11:01
question
Advanced Placement (AP), 05.05.2020 11:01
question
Mathematics, 05.05.2020 11:01
question
Mathematics, 05.05.2020 11:01
Questions on the website: 13722362