Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
I = input().split()
r = int(I[0])
c = int(I[1])
Rsum = 0
Csum = (c + 1) * [0]

o = [[0 for i2 in range(c + 1)] for i1 in range(r + 1)]

for i in range(r + 1):
    if i < r:
        Irc = input().split()
    for j in range(c):
        if i < r:
            o[i][j] = int(Irc[j])
            Rsum += o[i][j]
            Csum[j] += o[i][j]
        else:
            o[i][j] += Csum[j]
            Rsum += o[i][j]
    o[i][c] = Rsum
    Csum[c] = o[i][r]
    Rsum = 0

for i in range(r + 1):
    for j in range(c + 1):
        print(str(o[i][j]), end = '')
        if j != c:
            print(' ', end = '')
    print()

Fixed submission:
I = input().split()
r = int(I[0])
c = int(I[1])
Rsum = 0
Csum = (c + 1) * [0]

o = [[0 for i2 in range(c + 1)] for i1 in range(r + 1)]

for i in range(r + 1):
    if i < r:
        Irc = input().split()
    for j in range(c):
        if i < r:
            o[i][j] = int(Irc[j])
            Rsum += o[i][j]
            Csum[j] += o[i][j]
        else:
            o[i][j] += Csum[j]
            Rsum += o[i][j]
    o[i][c] = Rsum
    Csum[c] = o[i][c]
    Rsum = 0

for i in range(r + 1):
    for j in range(c + 1):
        print(str(o[i][j]), end = '')
        if j != c:
            print(' ', end = '')
    print()

Buggy python submission (verdict: Runtime Error):
I = input().split()
r = int(I[0])
c = int(I[1])
Rsum = 0
Csum = (c + 1) * [0]

o = [[0 for i2 in range(c + 1)] for i1 in range(r + 1)]

for i in range(r + 1):
    if i < r:
        Irc = input().split()
    for j in range(c):
        if i < r:
            o[i][j] = int(Irc[j])
            Rsum += o[i][j]
            Csum[j] += o[i][j]
        else:
            o[i][j] += Csum[j]
            Rsum += o[i][j]
    o[i][c] = Rsum
    Csum[c] = o[i][r]
    Rsum = 0

for i in range(r + 1):
    for j in range(c + 1):
        print(str(o[i][j]), end = '')
        if j != c:
            print(' ', end = '')
    print()

Fixed submission:
I = input().split()
r = int(I[0])
c = int(I[1])
Rsum = 0
Csum = (c + 1) * [0]

o = [[0 for i2 in range(c + 1)] for i1 in range(r + 1)]

for i in range(r + 1):
    if i < r:
        Irc = input().split()
    for j in range(c):
        if i < r:
            o[i][j] = int(Irc[j])
            Rsum += o[i][j]
            Csum[j] += o[i][j]
        else:
            o[i][j] += Csum[j]
            Rsum += o[i][j]
    o[i][c] = Rsum
    Csum[c] = o[i][c]
    Rsum = 0

for i in range(r + 1):
    for j in range(c + 1):
        print(str(o[i][j]), end = '')
        if j != c:
            print(' ', end = '')
    print()
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print('%s', 'Yes' if a < b && b < c else 'No')


Fixed submission:
a, b, c = map(int, input().split())
print('%s' % 'Yes' if a < b and b < c else 'No')
Buggy python submission (verdict: Runtime Error):
W,H,x,y,r = list(map(int,input().split()))
print("No" if x<r or x+r>W or y<r y+r>H else "Yes")


Fixed submission:
W,H,x,y,r = list(map(int,input().split()))
print("No" if x<r or x+r>W or y<r or y+r>H else "Yes")
Buggy python submission (verdict: Runtime Error):
c = 1
while True:
    x = input()
    print("Case ", c, ": ", ) if x != 0 else return
    c += 1


Fixed submission:
c = 1
while True:
    x = int(input())
    if x == 0: break
    print("Case {}: {}".format(c, x))
    c += 1

Buggy python submission (verdict: Runtime Error):
c = 1
while True:
    x = input()
    print("Case ", c, ": ", x) if x != 0 else return
    c += 1


Fixed submission:
c = 1
while True:
    x = int(input())
    if x == 0: break
    print("Case {}: {}".format(c, x))
    c += 1

Buggy python submission (verdict: Runtime Error):
c = 1
while True:
    x = input()
    if x == 0 else return
    print("Case ", c, ": ", x) 
    c += 1


Fixed submission:
c = 1
while True:
    x = int(input())
    if x == 0: break
    print("Case {}: {}".format(c, x))
    c += 1

Buggy python submission (verdict: Runtime Error):
c = 1
while True:
    x = input()
    if x == 0 else break
    print("Case ", c, ": ", x) 
    c += 1


Fixed submission:
c = 1
while True:
    x = int(input())
    if x == 0: break
    print("Case {}: {}".format(c, x))
    c += 1

Buggy python submission (verdict: Runtime Error):
c = 1
while True:
    x = input()
    if x == 0: break
    print("Case ", c, ": ", x) 
    c += 1


Fixed submission:
c = 1
while True:
    x = int(input())
    if x == 0: break
    print("Case {}: {}".format(c, x))
    c += 1

Buggy python submission (verdict: Runtime Error):
c = 1
while True:
    x = int(input())
    if x == 0: return
    print("Case {}: {}".format(c, x))
    c += 1


Fixed submission:
c = 1
while True:
    x = int(input())
    if x == 0: break
    print("Case {}: {}".format(c, x))
    c += 1
Buggy python submission (verdict: Runtime Error):
number = input()
print("%d",number**3)

Fixed submission:
number = int(input())
print(number**3)
Buggy python submission (verdict: Runtime Error):
for line in sys.stdin:
    time = int(line)
    sec = time % 60
    rest = time / 60
    min = rest % 60
    hour = rest / 60
    print(str(int(hour)) + ":" + str(int(min)) + ":" + str(int(sec)))


Fixed submission:
import sys


def num_rest(num, base):
    return num % base, num / base


for line in sys.stdin:
    time = int(line)
    sec, rest = num_rest(time, 60)
    min, hour = num_rest(rest, 60)
    print(str(int(hour)) + ":" + str(int(min)) + ":" + str(int(sec)))
Buggy python submission (verdict: Runtime Error):
x=raw_input().split()
print x[0]*x[1],(x[0]+x[1])*2

Fixed submission:
x,y=map(int, raw_input().split())
print x*y,(x+y)*2
Buggy python submission (verdict: Runtime Error):
i = 0
while 1:
    i+=1
    v = raw_input()
    if not v:
       break
    print ('Case {}: {}'.format(i,v))

Fixed submission:
i = 0
while 1:
    i+=1
    v = raw_input()
    if v == '0':
       break
    print ('Case {}: {}'.format(i,v))
Buggy python submission (verdict: Runtime Error):
z = input()
d = {}
while 1:
    x = raw_input().split()
    print x
    if x[0] == '0':
        break
    else:
        d[x[0]] = d.get(x[0],[]) + [x[1]]

L = ['S','H','C','D']

for i in L:
    for j in sorted(d[i]):
        print i + " " + j

Fixed submission:
z = input()
d = {}
c = 0

L = ['S','H','C','D']
for i in L:
    for j in range(1,14):
        d[i] = d.get(i,[]) + [j]


while c < z:
    x = raw_input().split()
    d[x[0]].remove(int(x[1]))
    c += 1


for i in L:
    for j in sorted(d[i]):
        print i + " " + str(j)

Buggy python submission (verdict: Runtime Error):
z = input()
d = {}

L = ['S','H','C','D']
for i in L:
    for j in range(1,14):
        d[i] = d.get(i,[]) + [str(j)]


while 1:
    x = raw_input().split()
    if x[0] == '0':
        break
    else:
        d[x[0]].remove(x[1])


for i in L:
    for j in sorted(d[i]):
        print i + " " + j

Fixed submission:
z = input()
d = {}
c = 0

L = ['S','H','C','D']
for i in L:
    for j in range(1,14):
        d[i] = d.get(i,[]) + [j]


while c < z:
    x = raw_input().split()
    d[x[0]].remove(int(x[1]))
    c += 1


for i in L:
    for j in sorted(d[i]):
        print i + " " + str(j)
Buggy python submission (verdict: Runtime Error):
x = int(input()
print(x * x * x)

Fixed submission:
x=int(input()) 
print(x*x*x)
Buggy python submission (verdict: Runtime Error):
x = input().split(" ")
a = int(x[0])
b = int(x[1])

print((a * b), (a + b) * 2))

Fixed submission:
x = input().split()
 
a = int(x[0])
b = int(x[1])
 
print((a * b),((a + b) * 2))
Buggy python submission (verdict: Runtime Error):
x = input().split(' ')
x = list(map(int, x)).sort()

print(x[0], x[1], x[2])

Fixed submission:
(a, b, c) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
 
if a < b < c:
    print(a, b, c)
elif a < c < b:
    print(a, c, b)
elif b <= a <= c:
    print(b, a, c)
elif b <= c <= a:
    print(b, c, a)
elif c <= a <= b:
    print(c, a, b)
else:
    print(c, b, a)

Buggy python submission (verdict: Runtime Error):
nums = int(input().split())
nums.sort()
print(nums[0], nums[1], nums[2])

Fixed submission:
(a, b, c) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
 
if a < b < c:
    print(a, b, c)
elif a < c < b:
    print(a, c, b)
elif b <= a <= c:
    print(b, a, c)
elif b <= c <= a:
    print(b, c, a)
elif c <= a <= b:
    print(c, a, b)
else:
    print(c, b, a)
Buggy python submission (verdict: Runtime Error):
i = input().split(' ')
W = int(i[0])
H = int(i[1])
x = int(i[2])
y = int(i[3])
r = int(i[4])

if x - r >= 0 and y - r >=0 and x + r <= W and y + r <= H:
    print('Yes')
else('No')

Fixed submission:
(w, h, x, y, r) = input().split(' ')
w = int(w)
h = int(h)
x = int(x)
y = int(y)
r = int(r)
 
if 0 + r <= x <= w - r and 0 + r <= y <= h - r:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
(a, b) = [int(x) for x in input().split()]

x = a // b
y = a % b
z = a / b

print('{1} {2} {3:6f}'.format(x, y, z));

Fixed submission:
(a, b) = [int(i) for i in input().split()]
d = int (a / b)
r = a % b
f = a / b
print('%s %s %.5f' % (d, r, f))

Buggy python submission (verdict: Runtime Error):
(a, b) = [int(x) for x in input().split()]

x = a // b
y = a % b
z = a / b

print('{1} {2} {3:.6f}'.format(x, y, z));

Fixed submission:
(a, b) = [int(i) for i in input().split()]
d = int (a / b)
r = a % b
f = a / b
print('%s %s %.5f' % (d, r, f))
Buggy python submission (verdict: Runtime Error):
while True:
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)

    if op = '?':
        break
    elif op = '+':
        print(a + b)
    elif op = '-':
        print(a - b)
    elif op = '*':
        print(a * b)
    elif op = '/':
        print(a // b)

Fixed submission:
while True:
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)
    if op == '?':
        break
    elif op == '+':
        print(a + b)
        pass
    elif op == '-':
        print(a - b)
        pass
    elif op == '*':
        print(a * b)
        pass
    else:
        print(a // b)

Buggy python submission (verdict: Runtime Error):
while True:
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)

    if op = '?':
        break
    elif op = '+':
        print(a + b)
    elif op = '-':
        print(a - b)
    elif op = '*':
        print(a * b)
    elif op = '/':
        print(a // b)
    else:
        break

Fixed submission:
while True:
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)
    if op == '?':
        break
    elif op == '+':
        print(a + b)
        pass
    elif op == '-':
        print(a - b)
        pass
    elif op == '*':
        print(a * b)
        pass
    else:
        print(a // b)

Buggy python submission (verdict: Runtime Error):
 from sys import stdin
 
while True:
    (a, op, b) = stdin.readline().split(' ')
    a = int(a)
    b = int(b)
    if op == "?":
        break;
    elif op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)

Fixed submission:
while True:
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)
    if op == '?':
        break
    elif op == '+':
        print(a + b)
        pass
    elif op == '-':
        print(a - b)
        pass
    elif op == '*':
        print(a * b)
        pass
    else:
        print(a // b)
Buggy python submission (verdict: Runtime Error):
while True:
    (H, W) = [int(x) for x in input().split()]
    if H == W == 0:
        break

    for hc in range(H):
        for wc in range(W):
            if hc == 0 or hc == H - 1 or wc == 0 or wc == W - 1:
                print('#' , end = ' ')
            else:
                    print('.',  end = ' ')
          print()
    print()

Fixed submission:
while True:
    (H, W) = [int(x) for x in input().split()]
    if H == W == 0:
        break

    for hc in range(H):
        if hc == 0 or hc == H -1:
            print('#' * W)
        else:
            print('#' + '.' * (W -2) + '#')
    print()

Buggy python submission (verdict: Runtime Error):
while True:
    (H, W) = [int(x) for x in input().split()]
    if H == W == 0:
        break

    for hc in range(H):
        for wc in range(W):
            if hc == 0 or hc == H - 1 or wc == 0 or wc == W - 1:
                print('#' , end = ' ')
            else:
                print('.',  end = ' ')
          print()
    print()

Fixed submission:
while True:
    (H, W) = [int(x) for x in input().split()]
    if H == W == 0:
        break

    for hc in range(H):
        if hc == 0 or hc == H -1:
            print('#' * W)
        else:
            print('#' + '.' * (W -2) + '#')
    print()
Buggy python submission (verdict: Runtime Error):
while True:
  (H, W) = [int(x) for x in input().split()]
  if H == H == 0:
    break

  for hc in range(H):
    for wc int range(W):
      if (hc + wc) % 2 == 0:
        print('#', end ='')
      else:
        print('.', end ='')
    print()
  print()

Fixed submission:
while True:
  (H, W) = [int(i) for i in input().split()]
  if H == W == 0:
    break

  for hc in range(H):
    for wc in range(W):
      if (hc + wc) % 2 == 0:
        print('#', end='')
      else:
        print('.', end='')
    print()
  print()

Buggy python submission (verdict: Runtime Error):
while True:
  (H, W) = [int(i) for i in input().split()]
  if H == W == 0;
    break

  for hc in range(H):
    for wc in range(W):
      if (hc + wc) % 2 == 0:
        print('#', end='')
      else:
        print('.', end='')
    print()
  print()

Fixed submission:
while True:
  (H, W) = [int(i) for i in input().split()]
  if H == W == 0:
    break

  for hc in range(H):
    for wc in range(W):
      if (hc + wc) % 2 == 0:
        print('#', end='')
      else:
        print('.', end='')
    print()
  print()
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(1,n+1):
  x = i
  if x % 3 == 0 or x % 10 == 3:
    print(' {0}'.format(i), end='')
    continue

  x //= 10
  while x != 0:
    if x % 10 == 3:
      print(' {0}.format(i), end='')
    break

  x //= 10
print()

Fixed submission:
n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0:
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}'.format(i), end='')
      break
    x //= 10

print()

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0:
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}.format(i), end='')
    break
    x //= 10

print()

Fixed submission:
n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0:
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}'.format(i), end='')
      break
    x //= 10

print()

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0 or :
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}.format(i), end='')
      break
    x //= 10

print()

Fixed submission:
n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0:
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}'.format(i), end='')
      break
    x //= 10

print()

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0:
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}.format(i), end='')
      break
    x //= 10

print()

Fixed submission:
n = int(input())
for i in range(3,n+1):
  x = i
  if x % 3 == 0:
    print(' {0}'.format(i), end='')
    continue

  while x != 0:
    if x % 10 == 3:
      print(' {0}'.format(i), end='')
      break
    x //= 10

print()
Buggy python submission (verdict: Runtime Error):
input()
a = input().split()
a.reverse()
print(' '/join(a))

Fixed submission:
input()
number = input().split()
number.reverse()
print(' '.join(number))
Buggy python submission (verdict: Runtime Error):
cards = {
  'S': [r for f in range(1,13+1)],
  'H': [r for f in range(1,13+1)],
  'C': [r for f in range(1,13+1)],
  'D': [r for f in range(1,13+1)],
  }

n = int(input())
for nc in range(n):
  (s, r) = input().split()
  index = cards[s].index(int(r))
  del cards[s][index]

for s in ['S', 'H', 'C', 'D']:
  for r in cards[s]:
    print(s, r)

Fixed submission:
cards = {
        'S': [r for r in range(1,13+1)],
        'H': [r for r in range(1,13+1)],
        'C': [r for r in range(1,13+1)],
        'D': [r for r in range(1,13+1)],
        }
  
n = int(input())
for nc in range(n):
    (s, r) = input().split()
    index = cards[s].index(int(r))
    del cards[s][index]
  
for s in ['S', 'H', 'C', 'D']:
    for r in cards[s]:
        print(s, r)
Buggy python submission (verdict: Runtime Error):
(n,m) = [int(i) for i in input().split()]

A = []
for nc in range(n):
    A.append([int(i) for i in input().split()])

b = []
for mc in range(m):
    b.append([int(i) for i in input().split()])

product = []
for nc in range(n):
    total = 0
    for mc in range(m):
        total += A[nc][mc] * b[mc]

    product.append(total)

[print(p) for p in product]

Fixed submission:
(n, m) = [int(i) for i in input().split()]
 
A = []
b = []
 
for i in range(n):
    A.append([int(j) for j in input().split()])
 
for i in range(m):
    b.append(int(input()))
 
 
for i in range(n):
    c = 0 
    for j in range(m):
         c += A[i][j] * b[j]
    print(c)

Buggy python submission (verdict: Runtime Error):
(n,m) = [int(i) for i in input().split()]

A = []
for nc in range(n):
    A.append([int(i) for i in input().split()])

b = []
for mc in range(m):
    b.append([int(input()))

product = []
for nc in range(n):
    total = 0
    for mc in range(m):
        total += A[nc][mc] * b[mc]

    product.append(total)

[print(p) for p in product]

Fixed submission:
(n, m) = [int(i) for i in input().split()]
 
A = []
b = []
 
for i in range(n):
    A.append([int(j) for j in input().split()])
 
for i in range(m):
    b.append(int(input()))
 
 
for i in range(n):
    c = 0 
    for j in range(m):
         c += A[i][j] * b[j]
    print(c)

Buggy python submission (verdict: Runtime Error):
(n, m) = [int(i) for i in input().split()]
A = []
B = []
for i in range(n):
    A.append([int(j) for j in input().split()])

for i in range(m):
    B.append(int(input()))

for i in range(n):
    s = 0
    for j in range(m):
        m += A[i][j] * B[j]
    print(s)

Fixed submission:
(n, m) = [int(i) for i in input().split()]
 
A = []
b = []
 
for i in range(n):
    A.append([int(j) for j in input().split()])
 
for i in range(m):
    b.append(int(input()))
 
 
for i in range(n):
    c = 0 
    for j in range(m):
         c += A[i][j] * b[j]
    print(c)
Buggy python submission (verdict: Runtime Error):
while True:
    (m, fm r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    mf = m + f
    
    if m == -1 of f == -1 of mf < 30:
        print('F')
    elif mf < 50 and r < 50:
        print('D')
    elif mf < 65:
        print('C')
    elif mf < 80:
        print('B')
    else:
        print('A')

Fixed submission:
while True:
    m, f, r = map(int, input().strip().split())
    if m == f == r == -1: break

    if m == -1 or f == -1 or m + f < 30:
        print('F')
    elif m + f >= 80:
        print('A')
    elif m + f >= 65:
        print('B')
    elif m + f >= 50:
        print('C')
    elif m + f >= 30:
        print('C' if r >= 50 else 'D')

Buggy python submission (verdict: Runtime Error):
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    mf = m + f
    
    if m == -1 of f == -1 of mf < 30:
        print('F')
    elif mf < 50 and r < 50:
        print('D')
    elif mf < 65:
        print('C')
    elif mf < 80:
        print('B')
    else:
        print('A')

Fixed submission:
while True:
    m, f, r = map(int, input().strip().split())
    if m == f == r == -1: break

    if m == -1 or f == -1 or m + f < 30:
        print('F')
    elif m + f >= 80:
        print('A')
    elif m + f >= 65:
        print('B')
    elif m + f >= 50:
        print('C')
    elif m + f >= 30:
        print('C' if r >= 50 else 'D')

Buggy python submission (verdict: Runtime Error):
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    mf = m + f
    
    if m == -1 or == -1 of mf < 30:
        print('F')
    elif mf < 50 and r < 50:
        print('D')
    elif mf < 65:
        print('C')
    elif mf < 80:
        print('B')
    else:
        print('A')

Fixed submission:
while True:
    m, f, r = map(int, input().strip().split())
    if m == f == r == -1: break

    if m == -1 or f == -1 or m + f < 30:
        print('F')
    elif m + f >= 80:
        print('A')
    elif m + f >= 65:
        print('B')
    elif m + f >= 50:
        print('C')
    elif m + f >= 30:
        print('C' if r >= 50 else 'D')

Buggy python submission (verdict: Runtime Error):
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    mf = m + f
    
    if m == -1 or f == -1 of mf < 30:
        print('F')
    elif mf < 50 and r < 50:
        print('D')
    elif mf < 65:
        print('C')
    elif mf < 80:
        print('B')
    else:
        print('A')

Fixed submission:
while True:
    m, f, r = map(int, input().strip().split())
    if m == f == r == -1: break

    if m == -1 or f == -1 or m + f < 30:
        print('F')
    elif m + f >= 80:
        print('A')
    elif m + f >= 65:
        print('B')
    elif m + f >= 50:
        print('C')
    elif m + f >= 30:
        print('C' if r >= 50 else 'D')
Buggy python submission (verdict: Runtime Error):
while True:
    (n , x) = [int (i) for i in input().split()]
    if n == x == 0:
        break

    count = 0
    for a in range(1, n + 1 = 2):
        for b in range(a + 1, n + 1 - 1):
            for c in range(b + 1, n + 1 ):
                if (a + b + c) == x:
                    count += 1
    print(count)

Fixed submission:
while True:
    (n, x) = [int(i) for i in input().split()]
    if n == x == 0:
        break
    count = 0
    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            for k in range(j + 1, n + 1):
                if x - (i + j + k) == 0:
                    count += 1
                if x - (i + j + k) < 0:
                    break
    print(count)

Buggy python submission (verdict: Runtime Error):
while True:
    (n, x) = [int(i) for i in input().split()]
    count = 0
    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            for k in range(j + 1, n + 1):
                if x - (i + j + k) == 0:
                    count += 1
                if x - (i + j + k) < 0:
                    break
    print(count)

Fixed submission:
while True:
    (n, x) = [int(i) for i in input().split()]
    if n == x == 0:
        break
    count = 0
    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            for k in range(j + 1, n + 1):
                if x - (i + j + k) == 0:
                    count += 1
                if x - (i + j + k) < 0:
                    break
    print(count)