M = 100
N = 9
S = 1000

dp = Array.new(M+1) {Array.new(N+1) {Array.new(S+1) {0}}}
dp[0][0][0] = 1
for i in 0...M do
  dp[i+1] = Marshal.load(Marshal.dump(dp[i]))
  for j in 0...N do
    for k in 0...S-i do
      dp[i+1][j+1][k+i] += dp[i][j][k]
    end
  end
end

while (n, s = gets.split.map(&:to_i)).inject(:+) != 0 do
  p dp[M+1][n][s]
end