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, 21.06.2019 19:40
Microsoft introduced active directory with windows 2000. in server 2012, it is in now version 4. what are some new features in the new ad that were not present in windows 2000 ad?
Answers: 1
question
Computers and Technology, 22.06.2019 04:30
Kyle, a receptionist for a building supply company, recently won an award for saving his company money on their phone system. after being presented with kyle's research, the company changed the way in which it made long-distance phone calls and cut their expenses in this area by 75 percent. the new system the kyle's company most likely adopted was wired communications switching stations voip hdtv
Answers: 3
question
Computers and Technology, 22.06.2019 15:10
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
Nathan wants to create multiple worksheet containing common formatting styles for his team members. which file extension him to save these worksheets? nathan to create multiple worksheets with common styles. he needs to save them with the extension.
Answers: 1
You know the right answer?
The Acme Fireworks Company conducts its shows using a custom-designed firing line with multiple laun...
Questions
question
Mathematics, 24.01.2020 16:31
question
Mathematics, 24.01.2020 16:31
Questions on the website: 13722360