Problem 1058 · Medium

Minimize Rounding Error to Meet Target

Round each decimal price down or up so the rounded prices sum to the target, paying the least total rounding error.

Open the interactive visualisation