Answered step by step
Verified Expert Solution
Link Copied!

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 N pens. The refill in ith pen is A[ij]. 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, N.
The second line contains N space-seprated integers representing the refill A[1].
Output Format
Display the minimum possible value.
Sample Testcase #0
Testcase Input
3
124
Testcase Output
Copy
1.
Explanation
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

More Books

Students also viewed these Databases questions