n,x = map(int,input().split()) a = [-1]*n b = [-1]*n for i in range(n): a[i],b[i] = map(int,input().split()) a[i]-=1 ans = [0]*x for i in range(n): for j in range(b[i]): if i+j=0: if ans[i-j]