Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
while True:
    try:
        w = float(raw_input())
        if w <= 48.0:
            print  "light fly"
        elif w <= 51.0:
            print "fly"
        elif w <= 54.0:
            print "bantam"
        elif w <= 57.0:
            print "feather"
        elif w <= 60:
            print "light"
        elif w <= 64.0:
            print "light welter"
        elif w <= 69.0:
            print "welter"
        elif w <= 75.0:
            print "light middle"
        elif w <= 81.0
            print "middle"
        elif w <= 91.0:
            print "light heavy"
        else:
            print "heavy"
    except:
        break

Fixed submission:
while True:
    try:
        w = float(raw_input())
        if w <= 48.0:
            print  "light fly"
        elif w <= 51.0:
            print "fly"
        elif w <= 54.0:
            print "bantam"
        elif w <= 57.0:
            print "feather"
        elif w <= 60:
            print "light"
        elif w <= 64.0:
            print "light welter"
        elif w <= 69.0:
            print "welter"
        elif w <= 75.0:
            print "light middle"
        elif w <= 81.0:
            print "middle"
        elif w <= 91.0:
            print "light heavy"
        else:
            print "heavy"
    except:
        break
Buggy python submission (verdict: Runtime Error):
import math
r = 10000
sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
for i in range(1,sqrt):
    if p[i]:
        for j in range(2*i+1,r,i+1):
            p[j] = 0

while True:
    n = int(raw_input())
    if not n:
        break
    i, num, sum = 0, 1, 0
    while num < n:
        if p[i] == 1:
            num += 1
            sum += i
        i += 1
    print sum

Fixed submission:
while True:
    try:
        a,b,n = map(int, raw_input().split())
        s = 0
        for i in range(n):
            a = a%b*10
            s += a/b
        print s
    except:
        break
Buggy python submission (verdict: Runtime Error):
while True:
    a = float(raw_input())
    sum = a
    for i in range(2,11):
        if i % 2 == 0:
            a *= 2.0
            sum += a
        else:
            a /= 3.0
            sum += a
    print sum

Fixed submission:
while True:
    try:
        a = sum = float(raw_input())
        for i in range(2,11):
            if i % 2 == 0:
                a *= 2.0
                sum += a
            else:
                a /= 3.0
                sum += a
        print sum
    except:
        break
Buggy python submission (verdict: Runtime Error):
while True:
    try:
        xA,yA,xB,yB,xC,yC,xD,yD = map(float, raw_input().split())
        if (10000*(yB-yA))*(100000*(yD-yC)) +(100000*(xB-xA)*(100000*(xD-xC)) < 1.e-12:
            print "YES"
        else:
            print "NO"
    except:
        break

Fixed submission:
while True:
    try:
        xA,yA,xB,yB,xC,yC,xD,yD = map(float, raw_input().split())
        if abs((yB-yA)*(yD-yC) + (xB-xA)*(xD-xC)) < 1.e-10:
                print "YES"
        else:
            print "NO"
    except:
        break

Buggy python submission (verdict: Runtime Error):
while True:
    try:
        xA,yA,xB,yB,xC,yC,xD,yD = map(float, raw_input().split())
        if (yB-yA)*(yD-yC) + (xB-xA)*(xD-xC) == 0.0:
                print "YES"
            else:
                print "NO"
        else:
            print "NO"
    except:
        break

Fixed submission:
while True:
    try:
        xA,yA,xB,yB,xC,yC,xD,yD = map(float, raw_input().split())
        if abs((yB-yA)*(yD-yC) + (xB-xA)*(xD-xC)) < 1.e-10:
                print "YES"
        else:
            print "NO"
    except:
        break
Buggy python submission (verdict: Runtime Error):
def Check(xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2)
    # the case A's upper left point in B
    if xb1 <= xa1 <= xb2 and yb1 <= ya2 <= yb2:
        return True
    # the case A's upper rihgt point in B
    if xb1 <= xa2 <= xb2 and yb1 <= ya2 <= yb2:
        return True
    # the case A's lowerr left point in B
    if xb1 <= xa1 <= xb2 and yb1 <= ya1 <= yb2:
        return True
    # the case A's lowerr right point in B
    if xb1 <= xa2 <= xb2 and yb1 <= ya1 <= yb2:
        return True

while True:
    try:
        xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 = map(float, raw_input().split())
        print "YES" if Check(xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2) else "NO"
    except:
        break

Fixed submission:
while True:
    try:
        xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 = map(float, raw_input().split())
        print "NO" if (xb2 < xa1 or xa2 < xb1 or yb2 < ya1 or ya2 < yb1) else "YES"
    except:
        break
Buggy python submission (verdict: Runtime Error):
ls = ["o","x"]
while True:
    try:
        a = raw_input()
        for c in ls
            if a[::4] == c*3 or a[2:8:2] == c*3:
                print c
            else:
                for i in range(3):
                    if a[3*i:3*(i+1)] == c*3 or a[i::3] == c*3:
                        print c
                        break
                    elif i == 2:
                    print "d"
    except:
        break
            

Fixed submission:
while True:
    try:
        a = raw_input()
        if a[::4] == "ooo" or a[2:8:2] == "ooo":
            print "o"
        elif a[::4] == "xxx" or a[2:8:2] == "xxx":
            print "x"
        else:
            for i in range(3):
                if a[3*i:3*(i+1)] == "ooo" or a[i::3] == "ooo":
                    print "o"
                    break
                elif a[3*i:3*(i+1)] == "xxx" or a[i::3] == "xxx":
                    print "x"
                    break
                elif i == 2:
                    print "d"
    except:
        break
Buggy python submission (verdict: Runtime Error):
l = 12
def island(f,x,y,m):
    rf = f[:][:]
    if rf[y][x] == 1:
        rf[y][x] = m
        for i in [-1,1]:
            if 0 <= x+i <= l-1:
                rf = island(rf,x+i,y,m)
            if 0 <= y+i <= l-1:
                rf = island(rf,x,y+i,m)
    return rf

while True:
    f = []

    for i in range(l):
        f.append(map(int, list(raw_input())))
    for y in range(l):
        for x in range(l):
            f = island(f,x,y,m)
            m += 1

    m, ans = 2, []
    for i in range(l):
        for j in range(l):
            ans.append(f[i][j])
    print len(list(set(ans)))-1

    try   : raw_input()
    except: break

Fixed submission:
W,H = 12,12
dxy = [[1,0],[0,1],[-1,0],[0,-1]]
def solve(field,w,h):
	if 0 <= w < W and 0 <= h < H and field[h][w] == "1":
		field[h][w] = "0"
		for dx,dy in dxy:
			solve(field,w+dx,h+dy)

while 1:
	try:
		field = [list(raw_input()) for i in range(H)]
		ans = 0
		for h in range(H):
			for w in range(W):
				if field[h][w] == "1":
					solve(field,w,h)
					ans += 1
		print ans
		raw_input()
	except:
		break

Buggy python submission (verdict: Runtime Error):
File Edit Options Buffers Tools Python Help
def island(f,x,y,m):
    if f[y][x] == 1:
        f[y][x] = m
        for i in [-1,1]:
            if 0 <= x+i <= 11:
                f = island(f,x+i,y,m)
            if 0 <= y+i <= 11:
                f = island(f,x,y+i,m)
    return f
while True:
    f = []; m = 2
    for i in range(12):
        f.append(map(int, list(raw_input())))
    for y in range(12):
        for x in range(12):
            if f[y][x]:
                f = island(f,x,y,m)
                m += 1
    ans = []
    for i in range(12):
        for j in range(12):
            ans.append(f[i][j])
    ans = list(set(ans))
    print len(ans) - 1*ans.count(0)
    try:raw_input()
    except: break

Fixed submission:
W,H = 12,12
dxy = [[1,0],[0,1],[-1,0],[0,-1]]
def solve(field,w,h):
	if 0 <= w < W and 0 <= h < H and field[h][w] == "1":
		field[h][w] = "0"
		for dx,dy in dxy:
			solve(field,w+dx,h+dy)

while 1:
	try:
		field = [list(raw_input()) for i in range(H)]
		ans = 0
		for h in range(H):
			for w in range(W):
				if field[h][w] == "1":
					solve(field,w,h)
					ans += 1
		print ans
		raw_input()
	except:
		break
Buggy python submission (verdict: Runtime Error):
def bomb(field,x,y):
    rfield = field[:][:]
    rfield[y][x] = 0
    for i in range(-3,4):
        if 0 <= x+i <= 7:
            if rfield[y][x+i] == 1:
                rfield = bomb(rfield,x+i,y)
        if 0 <= y+i <= 7:
            if rfield[y+i][x] == 1:
                rfield = bomb(rfield,x,y+i)
    return rfield


n = int(raw_input())
for data in range(1,n+1):
    # read condition
    field = []
    for line in range(8):
        field.append(map(int, list(raw_input())))
    x = int(raw_input())-1
    y = int(raw_input())-1

    # bombing!
    field = bomb(field,x,y)

    # print result
    print "Data %d:"%(data)
    for i in range(8):
        print "".join(map(str, field[i]))

Fixed submission:
def bomb(f,x,y):
    rf = f[:][:]
    rf[y][x] = 0
    for i in [-3,-2,-1,1,2,3]:
        if 0 <= x+i <= 7:
            if rf[y][x+i] == 1: rf = bomb(rf,x+i,y)
        if 0 <= y+i <= 7:
            if rf[y+i][x] == 1: rf = bomb(rf,x,y+i)
    return rf


n = int(raw_input())
for data in range(1,n+1):
    f = []
    raw_input()
    for line in range(8):
        f.append(map(int, list(raw_input())))
    x = int(raw_input())-1
    y = int(raw_input())-1

    f = bomb(f,x,y)

    print "Data %d:"%(data)
    for i in range(8):
        print "".join(map(str, f[i]))

Buggy python submission (verdict: Runtime Error):
def bomb(field,x,y):
    rfield = field[:][:]
    rfield[y][x] = 0
    for i in range(-3,4):
        if 0 <= x+i <= 7:
            if rfield[y][x+i] == 1:
                rfield = bomb(rfield,x+i,y)
        if 0 <= y+i <= 7:
            if rfield[y+i][x] == 1:
                rfield = bomb(rfield,x,y+i)
    return rfield


n = int(raw_input())
for data in range(1,n+1):
    # read condition
    dammy = raw_input
    field = []
    for line in range(8):
        field.append(map(int, list(raw_input())))
    x = int(raw_input())-1
    y = int(raw_input())-1

    # bombing!
    field = bomb(field,x,y)

    # print result
    print "Data %d:"%(data)
    for i in range(8):
        print "".join(map(str, field[i]))

Fixed submission:
def bomb(f,x,y):
    rf = f[:][:]
    rf[y][x] = 0
    for i in [-3,-2,-1,1,2,3]:
        if 0 <= x+i <= 7:
            if rf[y][x+i] == 1: rf = bomb(rf,x+i,y)
        if 0 <= y+i <= 7:
            if rf[y+i][x] == 1: rf = bomb(rf,x,y+i)
    return rf


n = int(raw_input())
for data in range(1,n+1):
    f = []
    raw_input()
    for line in range(8):
        f.append(map(int, list(raw_input())))
    x = int(raw_input())-1
    y = int(raw_input())-1

    f = bomb(f,x,y)

    print "Data %d:"%(data)
    for i in range(8):
        print "".join(map(str, f[i]))
Buggy python submission (verdict: Runtime Error):
n,m = int(raw_input()),int(raw_input())
s = [map(int, raw_input().split(",")) for i in range(m)]
s = sorted(s, key=lambda x:x[2])
ls = range(n)
ref = ls[:]
ans = 0
for i in s:
    x,y,d = s.pop(0)
    a,b = ref[x],ref[y]
    if a != b
        for j in ls:
            if ref[j] == a: ref[j] = b
        ans += d/100 - 1
print ans 

Fixed submission:
while True:
	n = int(raw_input())
	if n == 0: break
	m = int(raw_input())
	s = [map(int, raw_input().split(",")) for i in range(m)]
	s = sorted(s, key=lambda x:x[2])
	ls = range(n)
	ref = ls[:]
	ans = 0
	while s:
	    x,y,d = s.pop(0)
	    a,b = ref[x],ref[y]
	    if a != b:
	        for j in ls:
	            if ref[j] == a: ref[j] = b
	        ans += d/100 - 1
	print ans
Buggy python submission (verdict: Runtime Error):
import math

while True:
    n = int(raw_input())
    if n == -1:
        break
    r, theta = math.sqrt(2.0), pi/4.0
    for i in range(1,n-1):
        r = math.sqrt(r**2 + 1.0)
        theta += math.asin(1.0/r)
    print r*math.cos(theta)
    print r*math.sin(theta)

Fixed submission:
import math

while True:
    n = int(raw_input())
    if n == -1:
        break
    r, theta = 1.0, 0.0
    for i in range(n-1):
        r = math.sqrt(r**2 + 1.0)
        theta += math.asin(1.0/r)
    print r*math.cos(theta)
    print r*math.sin(theta)
Buggy python submission (verdict: Runtime Error):
while True:
    inp = raw_input()
    msg = ""
    for i in range(len(inp)):
        if inp[i] == "@": msg += inp[i+2]*int(inp[i+1])
        else: msg += inp[i]
    print msg

Fixed submission:
while True:
    try:
        inp = raw_input()
        i, msg = 0, ""
        while i < len(inp):
            if inp[i] == "@":
                msg += inp[i+2]*int(inp[i+1])
                i += 3
            else:
                msg += inp[i]
                i += 1
        print msg
    except:
        break

Buggy python submission (verdict: Runtime Error):
import sys
for inp sys.stdin:
    msg = ""
    for i in range(len(inp)):
        if inp[i] == "@": msg += inp[i+2]*int(inp[i+1])
        else: msg += inp[i]
    print msg

Fixed submission:
while True:
    try:
        inp = raw_input()
        i, msg = 0, ""
        while i < len(inp):
            if inp[i] == "@":
                msg += inp[i+2]*int(inp[i+1])
                i += 3
            else:
                msg += inp[i]
                i += 1
        print msg
    except:
        break
Buggy python submission (verdict: Runtime Error):
while True:
    n = int(raw_input())
    if n == 0:
        break
    magic = [[0 for i in range(n)] for i in range(n)]
    x, y = n/2, n/2
    magic[y][x] = 1
    count = 2
    while count <= n**2:
        x, y = (x+1)%n, (y+1)%n
        if magic[y][x] == 0:
            magic[y][x] = count
            count += 1
        else:
            x, y = (x-1)%n, (y+1)%n
            magic[y][x] = count
            count += 1
    for i in xrange(n):
        print "".join(map(lambda s:str(s).rjust(4),board[i])

Fixed submission:
while True:
    n = int(raw_input())
    if n == 0:
        break
    magic = [[0 for i in range(n)] for i in range(n)]
    x, y = n/2, n/2+1
    magic[y][x] = 1
    count = 2
    while count <= n**2:
        x, y = (x+1)%n, (y+1)%n
        if magic[y][x] == 0:
            magic[y][x] = count
            count += 1
        else:
            x, y = (x-1)%n, (y+1)%n
            magic[y][x] = count
            count += 1
    for i in xrange(n):
        print "".join(map(lambda s:str(s).rjust(4),magic[i]))
Buggy python submission (verdict: Runtime Error):
cart = [4,1,4,1,2,1,2,1]
while True:
	try:
		que = map(int, raw_input().split())
		mx,mxcart = 0, "99999999"
		for sp in range(8):
			sm = 0
			for num in range(8):
				if cart[(sp+num)%8] <= que[num]:
					sm += cart[(sp+num)%8]
				else:
					sm += que[num]
			if sm = mx:
				mx = sm
				mxcart = "".join(map(str, cart[sp:]+cart[:sp]))
			elif sm = mx:
				acart = "".join(map(str, cart[sp:]+cart[:sp]))
				if int(mxcart) > int(acart):
					mxcart = acart
		print " ".join(map(str, mxcart))
	except:
		break

Fixed submission:
c = [4,1,4,1,2,1,2,1]
while True:
	try:
		que = map(int, raw_input().split())
		mx,mxc = 0, "99999999"
		for sp in range(8):
			sm = 0
			for num in range(8):
				sm += c[(sp+num)%8] if c[(sp+num)%8] <= que[num] else que[num]
			if sm > mx:
				mx = sm
				mxc = "".join(map(str, c[sp:]+c[:sp]))
			elif sm == mx:
				ac = "".join(map(str, c[sp:]+c[:sp]))
				if int(mxc) > int(ac):
					mxc = ac
		print " ".join(map(str, mxc))
	except:
		break

Buggy python submission (verdict: Runtime Error):
cart = [4,1,4,1,2,1,2,1]
while True:
	try:
		que = map(int, raw_input().split())
		mx,mxcart = 0, "99999999"
		for sp in range(8):
			sm = 0
			for num in range(8):
				if cart[(sp+num)%8] <= que[num]:
					sm += cart[(sp+num)%8]
				else:
					sm += que[num]
			if sm = mx:
				mx = sm
				mxcart = "".join(map(str, cart[sp:]+cart[:sp]))
			elif sm == mx:
				acart = "".join(map(str, cart[sp:]+cart[:sp]))
				if int(mxcart) > int(acart):
					mxcart = acart
		print " ".join(map(str, mxcart))
	except:
		break

Fixed submission:
c = [4,1,4,1,2,1,2,1]
while True:
	try:
		que = map(int, raw_input().split())
		mx,mxc = 0, "99999999"
		for sp in range(8):
			sm = 0
			for num in range(8):
				sm += c[(sp+num)%8] if c[(sp+num)%8] <= que[num] else que[num]
			if sm > mx:
				mx = sm
				mxc = "".join(map(str, c[sp:]+c[:sp]))
			elif sm == mx:
				ac = "".join(map(str, c[sp:]+c[:sp]))
				if int(mxc) > int(ac):
					mxc = ac
		print " ".join(map(str, mxc))
	except:
		break
Buggy python submission (verdict: Runtime Error):
msg = map(str, raw_input().replace(",","").replace(".","").split())
for w in msg:
	print w, if 2 < len(w) <7 else ""

Fixed submission:
msg = map(str, raw_input().replace(",","").replace(".","").split())
print " ".join(filter(lambda w:2<len(w)<7, msg))
Buggy python submission (verdict: Runtime Error):
while True:
      n, m = map(int, raw_input().split())
      if n == 0 and m == 0:
            break
      p = [1 for i in range(n)]
      pn = n; count = 0
      while pn > 1:
            for i in range(n):
                  if p[i] == 1:
                        count += 1
                        if count == m:
                              p[i] = 0
                              pn -= 1
                              count = 0
      print p.index(1)+1

Fixed submission:
while True:
      n, m = map(int, raw_input().split())
      if n == 0 and m == 0:
            break
      p = [ i+1 for i in range(n) ]
      np = n; a = 0
      while np > 1:
            a = (a+m-1)%len(p)
            p.pop(a)
            np -= 1
      print p[0]

Buggy python submission (verdict: Runtime Error):
while True:
      n, m = map(int, raw_input().split())
      if n == 0 and m == 0:
            break
      p = [ 1 for i in range(n) ]
      pn = n; count = 0
      while pn > 1:
            for i in range(n):
                  if p[i] == 1:
                        count += 1
                        if count == m:
                              p[i] = 0
                              pn -= 1
                              count = 0
      print p.index(1)+1

Fixed submission:
while True:
      n, m = map(int, raw_input().split())
      if n == 0 and m == 0:
            break
      p = [ i+1 for i in range(n) ]
      np = n; a = 0
      while np > 1:
            a = (a+m-1)%len(p)
            p.pop(a)
            np -= 1
      print p[0]

Buggy python submission (verdict: Runtime Error):
while True:
      n, m = map(int, raw_input().split())
      if n == 0 and m == 0:
            break
      p = [ 1 for i in range(n) ]
      pn = n; count = 0; flag = 1
      while flag = 1:
            for i in range(n):
                  if p[i] == 1:
                        count += 1
                        if count == m:
                              p[i] = 0
                              count = 0
                              pn -= 1
                              if pn == 1:
                                    flag = 0
                                    break

      print p.index(1)+1

Fixed submission:
while True:
      n, m = map(int, raw_input().split())
      if n == 0 and m == 0:
            break
      p = [ i+1 for i in range(n) ]
      np = n; a = 0
      while np > 1:
            a = (a+m-1)%len(p)
            p.pop(a)
            np -= 1
      print p[0]
Buggy python submission (verdict: Runtime Error):
while True:
    inp = map(str, raw_input().split())
    stuck = []
    for i in inp:
        if i == "+":
            stuck.append(int(stuck.pop(len(stuck)-2)) + int(stuck.pop(len(stuck)-1)) )
        elif i == "-":
            stuck.append(int(stuck.pop(len(stuck)-2)) - int(stuck.pop(len(stuck)-1)) )
        elif i == "*":
            stuck.append(int(stuck.pop(len(stuck)-2)) * int(stuck.pop(len(stuck)-1)) )
        elif i == "/":
            stuck.append(int(stuck.pop(len(stuck)-2)) / float(stuck.pop(len(stuck)-1)) )
        else:
            stuck.append(i)
    print stuck

Fixed submission:
while True:
    try:
        inp = map(str, raw_input().split())
        s = []
        for i in inp:
            if   i == "+": s.append( s.pop(-2) + s.pop(-1) )
            elif i == "-": s.append( s.pop(-2) - s.pop(-1) )
            elif i == "*": s.append( s.pop(-2) * s.pop(-1) )
            elif i == "/": s.append( s.pop(-2) / s.pop(-1) )
            else: s.append(float(i))
        print s[0]
    except:
        break
Buggy python submission (verdict: Time Limit Exceeded):
def path(w,h,sm):
	if w < 0 or len(inp[h])-1 < w: return 0
	sm += inp[h][w]
	if h == c-1: return sm
	if h < c/2:	return max(path(w,h+1,sm),path(w+1,h+1,sm))
	else: return max(path(w,h+1,sm),path(w-1,h+1,sm))
		
c = 0
inp = []
while True:
	try:
		inp.append(map(int, raw_input().split(",")))
		c += 1
	except:
		print path(0,0,0)
		break

Fixed submission:
def mx(p,w,h,l):
	if h <= c/2:
		if w == 0: p[h][w] += p[h-1][w]
		elif w == l-1: p[h][w] += p[h-1][w-1]
		else: p[h][w] += max(p[h-1][w],p[h-1][w-1])
	else:
		p[h][w] += max(p[h-1][w],p[h-1][w+1])
	return p

c = 0
p = []
while True:
	try:
		p.append(map(int, raw_input().split(",")))
		c += 1
	except:
		break
	
for h in range(1,c):
	l = len(p[h])
	for w in range(l):
		p = mx(p,w,h,l)
print p[c-1][0]

Buggy python submission (verdict: Runtime Error):
def mx(p,w,h,l):
	if h <= c/2:
		if w == 0: p[h][w] += p[h-1][w]
		elif w == l-1: p[h][w] += p[h-1][w-1]
		else: p[h][w] += max(p[h-1][w],p[h-1][w-1])
	else:
		p[h][w] += max(p[h-1][w],p[h-1][w+1])
	return p

c = 0
p = []
while True:
	try:
		p.append(map(int, raw_put().split(",")))
		c += 1
	except:
		break
	
for h in range(1,c):
	l = len(p[h])
	for w in range(l):
		p = mx(p,w,h,l)
print p[c-1][0]

Fixed submission:
def mx(p,w,h,l):
	if h <= c/2:
		if w == 0: p[h][w] += p[h-1][w]
		elif w == l-1: p[h][w] += p[h-1][w-1]
		else: p[h][w] += max(p[h-1][w],p[h-1][w-1])
	else:
		p[h][w] += max(p[h-1][w],p[h-1][w+1])
	return p

c = 0
p = []
while True:
	try:
		p.append(map(int, raw_input().split(",")))
		c += 1
	except:
		break
	
for h in range(1,c):
	l = len(p[h])
	for w in range(l):
		p = mx(p,w,h,l)
print p[c-1][0]
Buggy python submission (verdict: Time Limit Exceeded):
def mx(ls,n):
    sm = 0
    for i in range(n):
        sm += ls.pop()
    return sm

def mn(ls,n):
    sm = 0
    for i in range(n):
        sm += ls.pop(0)
    return sm

def soi(ls,n,s):
    if n == 0:
        if s == 0:
            return 1
        else:
            return 0
    else:
        count = 0
        l = len(ls)
        for i in range(l):
            rls = ls[:]
            k = rls.pop(i)
            if s-k >= mn(rls,n-1):
                if s-k <= mx(rls,n-1):
                    count += soi(rls,n-1,s-k)
                else:
                    break
        return count

ls = [i for i in range(101)]
while True:
    n, s = map(int, raw_input().split())
    if n == 0:
        break
    print soi(ls,n,s)

Fixed submission:
ls = [[0]*1001 for i in range(10)]
ls[0][0] = 1
for i in range(101):
	for j in range(9,0,-1):
		for k in range(i,1000):
			ls[j][k] += ls[j-1][k-i] 
	

while True:
	n,s = map(int, raw_input().split())
	if n == 0: break
	print ls[n][s]

Buggy python submission (verdict: Time Limit Exceeded):
def soi(n,s,m):
    if n == 0:
        if s == 0:
            return 1
        else:
            return 0
    else:
        count = 0
        for i in range(m,101):
            if s-i >= 0:
                count += soi(n-1,s-i,i+1)
        return count

while True:
    n, s = map(int, raw_input().split())
    if n == 0:
        break
    print soi(n,s,0)

Fixed submission:
ls = [[0]*1001 for i in range(10)]
ls[0][0] = 1
for i in range(101):
	for j in range(9,0,-1):
		for k in range(i,1000):
			ls[j][k] += ls[j-1][k-i] 
	

while True:
	n,s = map(int, raw_input().split())
	if n == 0: break
	print ls[n][s]

Buggy python submission (verdict: Time Limit Exceeded):
ls = [i for i in range(101)]
def comb(n,s,sp):
	if n == 0:
		return 1 if s == 0 else 0
	if sp+n > 100: return 0
	mn,mx = sum(ls[sp:sp+n]),sum(ls[::-1][:n])
	if s < mn or mx < s: return 0
	elif mn == s or mx == s: return 1
	
	sm = 0
	for i in range(sp,101):
		if ls[i] > s:
			break
		sm += comb(n-1,s-ls[i],i+1)
	return sm

while True:
	n,s = map(int, raw_input().split())
	if n == 0: break
	print comb(n,s,0)

Fixed submission:
ls = [[0]*1001 for i in range(10)]
ls[0][0] = 1
for i in range(101):
	for j in range(9,0,-1):
		for k in range(i,1000):
			ls[j][k] += ls[j-1][k-i] 
	

while True:
	n,s = map(int, raw_input().split())
	if n == 0: break
	print ls[n][s]