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.
Count subsets whose sum lies between k and total minus k with a 0/1 knapsack table; each such subset gives one ordered partition.