Constrained Subsequence Sum — CaffeCode