SPOJ MAIN72

Explanation
Bottom-up Dynamic Programming. Subset Sum Problem.

Input
2 2 0 1 3 2 3 2

Output
1 21

Explanations
F# : [http://adilakhter.wordpress.com/2013/02/27/spoj-8545-subset-sum-main72-with-dynamic-programming-and-f/ SPOJ 8545. Subset Sum (Main72) | with Dynamic Programming and F#]