K
K
keddad2018-12-28 18:08:58
Algorithms
keddad, 2018-12-28 18:08:58

How to find the minimum sequence of n elements whose sum would be >= x, even if you subtract any k elements from the sequence?

What should such an algorithm look like? Given the input number of elements n, the minimum sum x and the number of elements that can remove (A may not remove) k, you need to find such elements that their sum would be minimal, but would always be greater than or equal to x, and the number itself there would be n elements.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2018-12-29
@keddad

From the wording of the question, it seems to me that this problem should be solved analytically.
Why can't all n elements be x / (n - k)? Then removing any k will give x.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question