Problem 2518 · Hard

Number of Great Partitions

Count subsets whose sum lies between k and total minus k with a 0/1 knapsack table; each such subset gives one ordered partition.

Open the interactive visualisation