← All problemsSign in

FiberNazi Numbers

You are given m ranges, [ai, bi]. From each range you need to pick a number ki such that the minimum distance l between any two such ki and kj is maximum. Once you determine l, you need to maximize G(x) for a given x which is defined as: G(x) = kj1G(x-1) + kj2G(x-2) + kj3G(x-3) + ... + kjmG(x-m) The kj1, kj2 ... in the above expression are chosen by you, subject to the constraint that the minimu

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start