Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
if (n == x == 0) :
    break
count = 0
for a in range (1, n) :
    for b in range (2, n) :
        for c in range (3, n) :
            Sum = a + b + c
            if (Sum == x) :
                count += 1
print(count)

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while (n == x != 0) :
    n, x = map(int, input().split())
    if (n == x == 0) :
        break
    count = 0
    for a in range (1, n) :
        for b in range (2, n) :
            for c in range (3, n) :
                Sum = a + b + c
                if (Sum == x) :
                    count += 1
    print(count)

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

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

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

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

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

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

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break
    else:
        count = 0
        for a in range(1, n):
            for b in range(a + 1, n):
                for c in range(b + 1, n):
                    Sum = a + b + c
                    if (Sum == x):
                        count += 1 
    print(count)

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

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

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

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

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

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

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

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

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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

Buggy python submission (verdict: Runtime Error):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

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

Fixed submission:
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

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