Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Tyrell has an array arr, denoting the weights of N burgers. The burgers can be eaten only continously i . e in sequence as in

Tyrell has an array arr, denoting the weights of N burgers. The burgers can be eaten only continously i.e in sequence as in arr. What should be the minimum weight eating capacity per day, of Tyrell, to consume all the burgers in k days?
Input format
The first line will contain the size of an array, N
Next N lines will contain N integers denoting array arr.
The last line will contain integer k.
Constraints
1<=k<=N<=1000
1<=arr[i]<=500
Examples
Input:
10
1
2
3
4
5
6
7
8
9
10
5
Output:
15
Explanation:
k =5
arr =[1,2,3,4,5,6,7,8,9,10]
1st day: 1,2,3,4,5->15
2nd day: 6,7->13
3rd day: 8->8
4th day: 9->9
5th day: 10->10
Min Cap to eat in a day required ->15

Step by Step Solution

3.30 Rating (153 Votes )

There are 3 Steps involved in it

Step: 1

The problem essentially asks for the minimum eating capacity per day that Tyrell needs to consume al... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions