N,V,C = map(int, input().split()) VW = [list(map(int, input().split())) for _ in range(N)] DP = [0]*(V+1) for v,w in VW: w+=C for i in reversed(range(V)): if DP[i]>0 and i+v<=V and DP[i+v]0 and i+v<=V and DP[i+v]