Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We have a notebook and N pens. The refill in ith pen is A [ i j ] . We will choose one or two
We have a notebook and pens. The refill in ith pen is We will choose one or two pens and use them till the refill vanishes. Then will write in the notebook the total refill consumed.
We will do this until we have no pen with a refill left.
We have to minimise the difference between the maximum refill consumed and the minimum refill consumed. Find the minimum possible value.
Input Format
The first line contains the number of pens,
The second line contains spaceseprated integers representing the refill
Output Format
Display the minimum possible value.
Sample Testcase #
Testcase Input
Testcase Output
Copy
Explanation
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started