The Farmer get a string of consecutive pearls, it contants N pearls. each pearls worth Wi. Unfortunately, the Landlord discover these pearls, the Landlord require the Farmer divide the string of pearls into M short consecutive pearls, and the Landlord will get The most expensive short consecutive pearls.
The Farmer want to give the Landlord short consecutive pearls as cheap as possible.
For each case, print the least wealth of the short consecutive pearls Landlord will get.