Problem 1354 · Hard

Construct Target Array With Multiple Sums

Undo the operations from the target: the largest value came from the sum of the rest, so reduce it modulo that sum.

Open the interactive visualisation