Problem p03433 (python)

Fixed submission:
if __name__ == "__main__":
    N = int(input())
    A = int(input())
    remain = N % 500
    if remain <= A:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
import sys

if __name__ == "__main__":
    C1 = list(map(int, (input().split(' '))))
    C2 = list(map(int, (input().split(' '))))
    C3 = list(map(int, (input().split(' '))))

    for i in range(100, 101):
        for j in range(100, 101):
            for k in range(100, 101):
                col1 = C1[0] - i
                if col1 < 0:
                    break
                if col1 > 100:
                    break
                if (C2[0] - j) != col1:
                    break
                if (C3[0] - k) != col1:
                    break
                col2 = C1[1] - i
                if col2 < 0:
                    break
                if col2 > 100:
                    break
                if (C2[1] - j) != col2:
                    break
                if (C3[1] - k) != col2:
                    break
                col3 = C1[2] - i
                if col3 < 0:
                    break
                if col3 > 100:
                    break
                if (C2[2] - j) != col3:
                    break
                if (C3[2] - k) != col3:
                    break
                print('Yes')
                sys.exit()
    print('No')

Buggy submission (verdict: Runtime Error):
import sys

if __name__ == "__main__":
    C1 = list(map(int, (input().split(' '))))
    C2 = list(map(int, (input().split(' '))))
    C3 = list(map(int, (input().split(' '))))

    for i in range(101):
        for j in range(101):
            for k in range(101):
                col1 = C1[0] - i
                if col1 < 0:
                    break
                if (C2[0] - j) != col1:
                    break
                if (C3[0] - k) != col1:
                    break
                col2 = C1[1] - i
                if col2 < 0:
                    break
                if (C2[1] - j) != col2:
                    break
                if (C3[1] - k) != col2:
                    break
                col3 = C1[2] - i
                if col3 < 0:
                    break
                if (C2[2] - j) != col3:
                    break
                if (C3[2] - k) != col3:
                    break
                print('Yes')
                sys.exit()
    print('No')

Buggy submission (verdict: Runtime Error):
import sys

if __name__ == "__main__":
    C1 = list(map(int, (input().split(' '))))
    C2 = list(map(int, (input().split(' '))))
    C3 = list(map(int, (input().split(' '))))

    for i in range(100):
        for j in range(100):
            for k in range(100):
                col1 = C1[0] - i
                if col1 < 0:
                    break
                if (C2[0] - j) != col1:
                    break
                if (C3[0] - k) != col1:
                    break
                col2 = C1[1] - i
                if col2 < 0:
                    break
                if (C2[1] - j) != col2:
                    break
                if (C3[1] - k) != col2:
                    break
                col3 = C1[2] - i
                if col3 < 0:
                    break
                if (C2[2] - j) != col3:
                    break
                if (C3[2] - k) != col3:
                    break
                print('Yes')
                sys.exit()
    print('No')