def f(s, total): if total > V: dp[s] = 0 return 0 if dp[s] != -1: return dp[s] R = 0 for i in range(N): if (1<