Subset sum problem and input output added