Problem 2897 · Hard

Apply Operations on Array to Maximize Sum of Squares

Each bit can be moved between positions freely, so pack the bits into k numbers greedily, one bit column at a time.

Open the interactive visualisation