Problem 3685 · Hard

Subsequence Sum After Capping Elements

For each cap x, cap every element at x and run a subset-sum table; the table tells whether some subsequence reaches k.

Open the interactive visualisation