Question: You are given a sequenceA1,A2,...,AN. Let's call a contiguous subsequence ofAa segment . A segment is good if it can be divided into at mostKsegments
You are given a sequenceA1,A2,...,AN. Let's call a contiguous subsequence ofAasegment. A segment isgoodif it can be divided into at mostKsegments such that the sum of elements in each of these sub-segments is at mostS.
You need to find the maximum number of elements in a good segment.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
