qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import math  # noqa: F401
from typing import Dict, List, Optional, Tuple, Union  # noqa: F401


def sum_xor(A: List[int]) -> int:
    sum_ = 0
    for a in A:
        sum_ ^= a
    return sum_


def main(N: int, A: List[int]):
    sum_ = sum_xor(A)
    for a in A:
        print(a ^ sum_, end="")
    print()


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    main(N, A)


Fixed code:
import math  # noqa: F401
from typing import Dict, List, Optional, Tuple, Union  # noqa: F401


def sum_xor(A: List[int]) -> int:
    sum_ = 0
    for a in A:
        sum_ ^= a
    return sum_


def main(N: int, A: List[int]):
    sum_ = sum_xor(A)
    for a in A:
        print(a ^ sum_, end=" ")
    print()


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    main(N, A)
Buggy code:
N = int(input())
A = map(int, input().split())

XOR = 0
for a in A:
  XOR ^= a
for i in range(N):
  A[i] = A[i]^XOR
print(*A)
  

Fixed code:
N = int(input())
A = list(map(int, input().split()))
 
XOR = 0
for a in A:
  XOR ^= a
for i in range(N):
  A[i] = A[i]^XOR
print(*A)
Buggy code:
N = int(input())
A = list(map(int, input().split()))

s = 0
for i in range(N):
    s ^= A[i]
    print(s)
for i in range(N):
    ans = s^A[i]
    print(ans, end=" ")

Fixed code:
N = int(input())
A = list(map(int, input().split()))

s = 0
for i in range(N):
    s ^= A[i]
for i in range(N):
    ans = s^A[i]
    print(ans, end=" ")
Buggy code:
n = int(input())
list = [int(i) for i in input().split()]
total = 0
ans = []
for i in range(n):
    total = total ^ list[i]

print(total)
for j in range(n):
    ans.append(str(total^list[j]))
print(" ".join(ans))


Fixed code:
n = int(input())
list = [int(i) for i in input().split()]
total = 0
ans = []
for i in range(n):
    total = total ^ list[i]

for j in range(n):
    ans.append(str(total^list[j]))
print(" ".join(ans))
Buggy code:
n=int(input())
a=list(map(int,input().split()))
p=0
for x in a:
	p^=x
ans=[]
for x in a:
	ans.append(p^x)
print(ans)

Fixed code:
n=int(input())
a=list(map(int,input().split()))
p=0
for x in a:
	p^=x
ans=[]
for x in a:
	ans.append(p^x)
print(*ans)
Buggy code:
N = int(input())
A = list(map(int, input().split()))
count = 0
for i in A:
    count ^= x
for i in range(len(A)):
    A[i] ^= count
    
    
    
print(*A)

Fixed code:
N = int(input())
A = list(map(int, input().split()))
count = 0
for i in A:
    count ^= i
for i in range(len(A)):
    A[i] ^= count
    
    
print(*A)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
ans=[]
b=a.copy()
del b[0]
a1=0
for i in b:
    a1=a1^i
ans.append(a1)
for i in b:
    ansi=a1^i
    ans.append(ansi)

for i in range(n):
    print(ans[i],end=' ')

Fixed code:
n=int(input())
a=list(map(int,input().split()))
ans=[]
b=a.copy()
del b[0]
a1=0
a2=a[0]
for i in b:
    a1=a1^i
ans.append(a1)
for i in b:
    ansii=a1^i
    ansi=a2^ansii
    ans.append(ansi)

for i in range(n):
    print(ans[i],end=' ')
Buggy code:
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
totxor = reduce(lambda a, b: a^b, A, 0)
ans = []
for a in A:
    ans.append(totxor ^ a)
print(ans)

Fixed code:
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
totxor = reduce(lambda a, b: a^b, A, 0)
ans = []
for a in A:
    ans.append(str(totxor ^ a))
print(' '.join(ans))
Buggy code:
#!/usr/bin/env python3

def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = [None] * n
    for i in range(n - 1):
        allxor = a[i] ^ a[i + 1]
    for i in range(n):
        ans[i] = allxor ^ a[i]
    print(*ans)


if __name__ == "__main__":
    main()


Fixed code:
#!/usr/bin/env python3

def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = [None] * n
    allxor = 0
    for i in range(n):
        allxor ^= a[i]
    for i in range(n):
        ans[i] = allxor ^ a[i]
    print(*ans)


if __name__ == "__main__":
    main()
Buggy code:
n = int(input())
a = list(map(int, input().split()))

b = a[0]
for v in a[1:]:
    b ^= v
for v in a:
    print(v ^ b)
print(*map(lambda x: x ^ b, a))


Fixed code:
n = int(input())
a = list(map(int, input().split()))

b = a[0]
for v in a[1:]:
    b ^= v
print(*map(lambda x: x ^ b, a))
Buggy code:
def main():
    _ = int(input())
    a = tuple(map(int, input().split()))

    res = 0
    for i in a:
        res ^= i
    ans = [res ^ j for j in a]
    for k in ans:
        print(ans)


if __name__ == "__main__":
    main()

Fixed code:
def main():
    _ = int(input())
    a = tuple(map(int, input().split()))

    res = 0
    for i in a:
        res ^= i
    ans = [res ^ i for i in a]
    print(*ans)


if __name__ == "__main__":
    main()
Buggy code:
n = int(input())
arr = list(map(int, input().split()))
for i in arr:
  total ^= i
for i in arr:
  print(total ^ i, end=' ')

Fixed code:
n = int(input())
arr = list(map(int, input().split()))
total = 0
for i in arr:
  total ^= i
for i in arr:
  print(total ^ i, end=' ')
Buggy code:
n = int(input())
a=list(map(int,input().split()))
forward = []
back = []
result = ''
t = 0
for i in range(n):
    t ^= a[i]
    forward.append(t)
t = 0
for i in range(n-1, -1, -1):
    t ^= a[i]
    back.append(t)

print(forward, back)
for i in range(n):
    if i == 0:
        t = back[n-2]
    elif i == n-1:
        t = forward[n-2]
    else:
        t = forward[i-1] ^ back[n-2-i]
    result += str(t) + ' '

print(result)


Fixed code:
n = int(input())
a=list(map(int,input().split()))
forward = []
back = []
result = ''
t = 0
for i in range(n):
    t ^= a[i]
    forward.append(t)
t = 0
for i in range(n-1, -1, -1):
    t ^= a[i]
    back.append(t)

for i in range(n):
    if i == 0:
        t = back[n-2]
    elif i == n-1:
        t = forward[n-2]
    else:
        t = forward[i-1] ^ back[n-2-i]
    result += str(t) + ' '

print(result)
Buggy code:
n = int(input())
a = list(map(int,input().split()))

xor_a = 0
for i in range(n):
  xor_a ^= a[i]

print(xor_a)

ans = []
for i in range(n):
  ans.append(a[i] ^ xor_a)

print(*ans)


Fixed code:
n = int(input())
a = list(map(int,input().split()))
X = 0
for i in range(n):
    X = X^a[i]
ans = []
for i in range(n):
    ans.append(X^a[i])
print(*ans)
Buggy code:
N = int(input())
A = list(map(int, input().split()))

s = 0
for a in A:
	s ^= a
	print(s)
ans = []

for a in A:
	ans += [str(a ^ s)]
print(' ' .join(ans))

Fixed code:
N = int(input())
A = list(map(int, input().split()))

s = 0
for a in A:
	s ^= a
ans = []

for a in A:
	ans += [str(a ^ s)]
print(' ' .join(ans))
Buggy code:
    n = int(input())
    xor_arr = list(map(int, input().split()))
    xor_of_xor = 0
    for elm in xor_arr:
        xor_of_xor = xor_of_xor ^ elm
    scarf_val = [xor_of_xor ^ elm for elm in xor_arr]
     
    print(" ".join(str(x) for x in scarf_val))

Fixed code:
n = int(input())
xor_arr = list(map(int, input().split()))
xor_of_xor = 0
for elm in xor_arr:
    xor_of_xor = xor_of_xor ^ elm
scarf_val = [xor_of_xor ^ elm for elm in xor_arr]
         
print(" ".join(str(x) for x in scarf_val))
Buggy code:
import sys

input = sys.stdin.readline


def main():
    N =int(input())
    A = list(map(int,input().split()))

    init = 0
    for a in A:
        init ^=a
    print(init)
    for a in A:
        print(init^a,end=" ")

if __name__ == "__main__":
    main()

Fixed code:
import sys

input = sys.stdin.readline


def main():
    N =int(input())
    A = list(map(int,input().split()))

    init = 0
    for a in A:
        init ^=a
    for a in A:
        print(init^a,end=" ")

if __name__ == "__main__":
    main()
Buggy code:
n = int(input())
a = list(map(int, input().split()))
x = 0
for i in range(1, n):
  x = x^a[i]
  
l = [x]
for i in range(n-1):
  x = a[i]^a[i+1]
  l.append(l[i]^x)
print(l)



Fixed code:
n = int(input())
a = list(map(int, input().split()))
x = 0
for i in range(1, n):
  x = x^a[i]
  
l = [x]
for i in range(n-1):
  x = a[i]^a[i+1]
  l.append(l[i]^x)
print(*l)
Buggy code:
import sys
sys.setrecursionlimit(10**6)

n = int(input())
a = list(map(int, input().split()))
#n, m = map(int, input().split())
#s = input()
#s,t = input().split()
#a = [int(input()) for _ in range(n)]
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

su = 0

for i in range(1, n):
    su ^= a[i]
    
ans = [su]

for i in range(n-1):
    su = su ^ a[i] ^ a[i+1]
    ans.append(su)
    
print(*su)

Fixed code:
import sys
sys.setrecursionlimit(10**6)

n = int(input())
a = list(map(int, input().split()))
#n, m = map(int, input().split())
#s = input()
#s,t = input().split()
#a = [int(input()) for _ in range(n)]
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

su = 0

for i in range(1, n):
    su ^= a[i]
    
ans = [su]

for i in range(n-1):
    su = su ^ a[i] ^ a[i+1]
    ans.append(su)
    
print(*ans)
Buggy code:
n = int(input())
a = input().split(" ")

s = a[0]

for num in a[1:]:
	s^=num

ans = [0]*n

for i, num in enumerate(a):
	ans[i] = s^num

print(*ans)


Fixed code:
n = int(input())
aa = input().split(" ")
a = [int(c) for c in aa]

s = a[0]

for num in a[1:]:
	s ^= num

ans = [0]*n

for i, num in enumerate(a):
	ans[i] = s^num

print(*ans)
Buggy code:
N = int(input())
A = map(int, input().split())
total = 0
for a in A:
  total ^= a
result = []
for a in A:
  result.append(total ^ a)
print(result)

Fixed code:
N = int(input())
A = list(map(int, input().split()))
total = 0
for a in A:
  total ^= a
result = []
for a in A:
  result.append(total ^ a)
print(*result)
Buggy code:
N = int(input())
a = list(map(int, input().split()))

b = [0]*N

for i in range(1,N):
    b[i] = b[i-1] ^ a[i-1] ^ a[i]

print(" ".join(map(str, b)))

Fixed code:
N = int(input())
a = list(map(int, input().split()))

b = [0]*N

xorsum = 0
for i in range(1,N):
    b[i] = b[i-1] ^ a[i-1] ^ a[i]
    xorsum = xorsum ^ b[i]

b[0] = xorsum ^ a[0]

for i in range(1,N):
    b[i] = b[i-1] ^ a[i-1] ^ a[i]

print(" ".join(map(str, b)))
Buggy code:
import copy
def main():

    N = int(input())
    A =list(map(int, input().split()))
    AD = copy.copy(A)
    AAA = []

    while len(AD) > 1:
        if len(AD)%2==1:
            AD.append(0)
        for i in range(len(AD)//2):
            AAA.append(AD[i]^AD[i+1])
        AD = copy.copy(AAA)
        AAA.clear()
    
    for i in range(N):
        A[i] = AD[0] ^ A[i]
    
    print(*A)





if __name__ == '__main__':
    main()

Fixed code:
import copy
def main():

    N = int(input())
    A =list(map(int, input().split()))
    AD = copy.copy(A)
    AAA = []

    while len(AD) > 1:
        if len(AD)%2==1:
            AD.append(0)
        for i in range(0,len(AD),2):
            AAA.append(AD[i]^AD[i+1])
        AD = copy.copy(AAA)
        AAA.clear()
    
    for i in range(N):
        A[i] = AD[0] ^ A[i]
    
    print(*A)





if __name__ == '__main__':
    main()
Buggy code:
n=int(input())
a=list(map(int,input().split()))

X=[]
b=a[0]
for i in range(1,n) :
    b^=a[i]

for i in range(n) :
    x=b^a[i]
    X.append(x)

print(X)


Fixed code:
n=int(input())
a=list(map(int,input().split()))

X=[]
b=a[0]
for i in range(1,n) :
    b^=a[i]

for i in range(n) :
    x=b^a[i]
    X.append(x)

for i in X :
    print(i,end=" ")
Buggy code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    a = list(map(int, rl().split()))
    
    n = a[0]
    for i in range(1, N):
        n ^= a[i]
    for i in range(N):
        a[i] ^= n
    print(a)


if __name__ == '__main__':
    solve()


Fixed code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    a = list(map(int, rl().split()))
    
    n = a[0]
    for i in range(1, N):
        n ^= a[i]
    for i in range(N):
        a[i] ^= n
    print(*a)


if __name__ == '__main__':
    solve()
Buggy code:
n=int(input())
arr=list(map(int,input().split()))
xors=0
for val in arr:
  xors^=val
ans=[]
for i in range(n):
  ans.append(xors^arr[i])
print(ans)

Fixed code:
n=int(input())
arr=list(map(int,input().split()))
xors=0
for val in arr:
  xors^=val
ans=[]
for i in range(n):
  ans.append(xors^arr[i])
print(*ans)
Buggy code:
import sys
from typing import Callable, List, NoReturn

import numpy as np


def main() -> NoReturn:
    readline: Callable[[], str] = sys.stdin.readline
    n: int = int(readline().rstrip())
    a: np.ndarray = np.array(tuple(int(_) for _ in readline().rstrip().split()))

    xor_all: int = 0
    for a_n in a:
        xor_all ^= a_n

    values = np.bitwise_xor(a, xor_all)
    print(" ".join(values))


if __name__ == '__main__':
    main()


Fixed code:
import sys
from typing import Callable, List, NoReturn

import numpy as np


def main() -> NoReturn:
    readline: Callable[[], str] = sys.stdin.readline
    n: int = int(readline().rstrip())
    a: np.ndarray = np.array(tuple(int(_) for _ in readline().rstrip().split()))

    xor_all: int = 0
    for a_n in a:
        xor_all ^= a_n

    values = np.bitwise_xor(a, xor_all)
    print(" ".join(tuple(str(v) for v in  values)))


if __name__ == '__main__':
    main()
Buggy code:
n = int(input())
a = list(map(int, input().split()))
b = 0
for i in range(n):
    b ^= a[i]
ans = []
for i in range(n):
    ap = b ^ a[i]
    ans.append(ap)
print(*a)
print(*list(set(ans)))


Fixed code:
n = int(input())
a = list(map(int, input().split()))
b = 0
for i in range(n):
    b ^= a[i]
ans = []
for i in range(n):
    ap = b ^ a[i]
    ans.append(ap)

print(*ans)
Buggy code:
N = int(input())
a = list(map(int,input().split()))

tmp = 0
for i in a:
  tmp ^= i

ans = a[:]
for i in range(N):
  ans[i] ^= tmp
print(ans)

Fixed code:
N = int(input())
a = list(map(int,input().split()))

tmp = 0
for i in a:
  tmp ^= i

ans = a[:]
for i in range(N):
  ans[i] ^= tmp
print(*ans)
Buggy code:
N = int(input())
A = list(map(int, input().split()))
S=0
for a in A:
  S ^= a

b = [S^a for a in A]
print(b)

Fixed code:
N = int(input())
A = list(map(int, input().split()))
S=0
for a in A:
  S ^= a

b = [S^a for a in A]
print(*b)
Buggy code:
N = int(input())
a_list = list(map(int, input().split()))
all_xor = 0
res = []

for a in a_list:
    all_xor ^= a

for a in a_list:
    res.append(a ^ all_xor)

print(res)


Fixed code:
N = int(input())
a_list = list(map(int, input().split()))
all_xor = 0
res = []

for a in a_list:
    all_xor ^= a

for a in a_list:
    res.append(a ^ all_xor)

print(*res)
Buggy code:
n = int( input() )
a = list( map(int, input().split()) )
x = 0
for i in a:
    x ^= i
print( * list( map( lamda y: x^y , a ) ) )

Fixed code:
n = int( input() )
a = list( map(int, input().split()) )
x = 0
for i in a:
    x ^= i
print( * list( map( lambda y: x^y , a ) ) )
Buggy code:
from functools import reduce
def resolver(N, A):
    X = reduce(int.__xor__, A)
    ans = [X^a for a in A]
    
    return ans

def test():
    pass

def main():

    #test()

    N = int(input())
    A = list(map(int, input().split()))
    ans = resolver(N, A)

    print(ans)



if __name__ == '__main__':
    main()

Fixed code:
from functools import reduce
def resolver(N, A):
    X = reduce(int.__xor__, A)
    ans = [str(X^a) for a in A]
    
    return ans

def test():
    pass

def main():

    #test()

    N = int(input())
    A = list(map(int, input().split()))
    ans = resolver(N, A)

    print(" ".join(ans))
    



if __name__ == '__main__':
    main()
Buggy code:
n = int(input())
arr = list(map(int,input().split()))
xors = 0
for val in arr:
  xors^=val
ans = []
for i in range(n):
  ans.append(xros^arr[i])
  
print(*ans)

Fixed code:
n = int(input())
arr = list(map(int,input().split()))
xors = 0
for val in arr:
  xors^=val
ans = []
for i in range(n):
  ans.append(xors^arr[i])
  
print(*ans)
Buggy code:
n = int(input())
a = list(map(int,input().split()))
x = 0
for i in range(n):
    x = x^a[i]
print(x)
for i in range(n):
    print(x^a[i],end="")
    print(" ",end="")
print("")

Fixed code:
n = int(input())
a = list(map(int,input().split()))
x = 0
for i in range(n):
    x = x^a[i]
for i in range(n):
    print(x^a[i],end="")
    print(" ",end="")
print("")
Buggy code:
import sys
N = int(sys.stdin.readline().rstrip())
A = list(map(int, sys.stdin.readline().rstrip().split()))
S= 0
for n in range(N):
  S = S^A[n]
  print(S)
  
ans = ''
for n in range(N):
  m = S^A[n]
  ans += str(m) + ' '

print(ans)

Fixed code:
import sys
N = int(sys.stdin.readline().rstrip())
A = list(map(int, sys.stdin.readline().rstrip().split()))
S= 0
for n in range(N):
  S = S^A[n]
  
ans = ''
for n in range(N):
  m = S^A[n]
  ans += str(m) + ' '

print(ans[:-1])
Buggy code:
def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
x = 7
if 360%x == 0:
    print(int(360/x))
else :
    print(int(lcm(360,x)/x))


Fixed code:
def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
x = int(input())
if 360%x == 0:
    print(int(360/x))
else :
    print(int(lcm(360,x)/x))
Buggy code:
import numpy as np

X = int(input())
X_lcm = np.lcm(360, 360-X)
print(X_lcm // X)


Fixed code:
import numpy as np
 
X = int(input())
X_lcm = np.lcm(360, X)
print(X_lcm // X)
Buggy code:
a=int(input())
x = 0
i = 1
while(1):
  x += a
  i += 1
  x %= 360
  if x:
    continue
  else:
    print(i)
    quit()

Fixed code:
a=int(input())
x = 0
i = 0
while(1):
  x += a
  i += 1
  x %= 360
  if x:
    continue
  else:
    print(i)
    quit()
Buggy code:
X=int(input())
K=0
a=0
while True:
  a+=X
  K+=1
  if K%360==0:
    break
print(K)

Fixed code:
X=int(input())
K=0
a=0
while True:
  a+=X
  K+=1
  if a%360==0:
    break
print(K)
Buggy code:
X=int(input())
import math
print(360*X//math.gcd(360,X)

Fixed code:
X=int(input())
import math
a=360*X//math.gcd(360,X)
print(a//X)
Buggy code:
X=int(input())
i=1
while True:
  X=X*i
  if X%360==0:
    print(i)
    break
  i+=1

Fixed code:
X = int(input())
i = 1
while True:
    if (X * i) % 360 == 0:
        break
    i += 1
print(i)
Buggy code:
# import matplotlib.pyplot as plt
import math
 
def lcm(x, y):
   if x > y:
       z = x
   else:
       z = y
 
   while(True):
       if((z % x == 0) and (z % y == 0)):
           lcm = z
           break
       z += 1
 
   return lcm

X = int(input())
print(lcm(X, 360) / X)

Fixed code:
# import matplotlib.pyplot as plt
import math
 
def lcm(x, y):
   if x > y:
       z = x
   else:
       z = y
 
   while(True):
       if((z % x == 0) and (z % y == 0)):
           lcm = z
           break
       z += 1
 
   return lcm

X = int(input())
print(int(lcm(X, 360) / X))
Buggy code:
# do simulation

X = int(input())
Y, K = 0, 0
while True:
  Y += X
  K += 1
  if Y % 360 == 0:
    print(k)
    exit()

Fixed code:
# do simulation

X = int(input())
Y, K = 0, 0
while True:
  Y += X
  K += 1
  if Y % 360 == 0:
    print(K)
    exit()
Buggy code:
def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
 
 

num1 = int(input())
a=lcm(num1,360)
b=a/360
print(b)

Fixed code:
def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
 
 
 
num1 = int(input())
a=lcm(num1,360)
b=a/num1
print(int(b))
Buggy code:
def solve(x):
    k = 0
    while k*x % 360 != 0:
        k += 1
    return k
    
x = int(input())
print(solve(x))

Fixed code:
def solve(x):
    k = 1
    while k*x % 360 != 0:
        k += 1
    return k

x = int(input())
print(solve(x))
Buggy code:
n=int(input())
for i in range(1,361):
  if n**i%360==0:
    print(i)
    

Fixed code:
n = int(input())
for i in range(1,361):
    if n*i%360 == 0:
        print(i)
        break
Buggy code:
x=int(input())
import math
K=360/math.gcd(x,360)
print(K)


Fixed code:
x=int(input())
import math
K=360//math.gcd(x,360)
print(K)
Buggy code:
import math

x = int(input())
y = 360

lcm = x * y // math.gcd(x, y)
print(lcm/x)

Fixed code:
import math

x = int(input())
y = 360

lcm = x * y // math.gcd(x, y)
print(lcm//x)
Buggy code:
X=int(input())
Y =360
while 1:
	if Y % X == 0:
		print(Y/X)
		break
	else:
		Y += 360

Fixed code:
X=int(input())
Y =360
while 1:
	if Y % X == 0:
		print(Y//X)
		break
	else:
		Y += 360
Buggy code:
n=int(input())
#n*k1=(360)*k2
#(k1/k2)=(360/n)
k=1
while((k*n)%360!=0):
  k+=1
  print(k)

Fixed code:
n=int(input())
#n*k1=(360)*k2
#(k1/k2)=(360/n)
k=1
while((k*n)%360!=0):
  k+=1
print(k)
Buggy code:
X = int(input())

K=1
y=X % 360
while y != 0:
  K+=1
  y=(y+X)% 360
#
print(k)



Fixed code:
X = int(input())

K=1
y=X % 360
while y != 0:
  K+=1
  y=(y+X)% 360
#
print(K)
Buggy code:
n=int(input())
print(int(360/math.gcd(n,360)))

Fixed code:
import math
n = int(input())
print(360 // math.gcd(360, n))
Buggy code:
import math
y = int(input())
print(y*360//math.gcd(y,360))

Fixed code:
import math
y = int(input())
print(360//math.gcd(y,360))
Buggy code:
import math

k = 1
x = float(input())
while  x*k%360 == 0:
  k += 1	
print(k)


Fixed code:
import math
 
k = 1
x = float(input())
while  x*k%360 != 0:
  k += 1	
print(k)
Buggy code:
X = int(input)

ans = 0
while(1):
  ans += 1
  if (X * ans) % 360 == 0:
    print(ans)
    break

Fixed code:
X = int(input())
 
ans = 0
while(1):
  ans += 1
  if (X * ans) % 360 == 0:
    print(ans)
    break
Buggy code:
y=x=int(input())
while y%360:y+=x
print(y/x)

Fixed code:
y=x=int(input())
while y%360:y+=x
print(y//x)
Buggy code:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()

def main():
    X = ii()
    print(360//math.gcd(X,360))

if __name__ == "__main__":
  main()


Fixed code:
import math
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()

def main():
    X = ii()
    print(360//math.gcd(X,360))

if __name__ == "__main__":
  main()
Buggy code:
X = int(input())

r = X
ans = 0
while True:
  r += X
  r %= 360
  ans += 1
  if r == 0:
    break
print(ans)

Fixed code:
X = int(input())

r = 0
ans = 0
while True:
  r += X
  r %= 360
  ans += 1
  if r == 0:
    break
print(ans)
Buggy code:
import math
X = int(input())
g = math.gcd(360, X)
print(X*360//g)


Fixed code:
import math

X = int(input())

g = math.gcd(X, 360)
l = X*360//g
print(l//X)
Buggy code:
def gcd(a,b):
  if b == 0:return a
  return gcd(b,a%b)

a = int(input())
print(360/gcd(360,a))

Fixed code:
def gcd(a,b):
    if b==0: return a
    return gcd(b,a%b)

x=int(input())
print(360//gcd(360,x))
Buggy code:
x=int(input())
i=0
while True:
  360*i%x!=0
  i+=1
  if 360*i%x==0:
    break
k=360*i/x
print(k)


Fixed code:
x = int(input())
i = 1
while True:
    k = (360 * i) / x
    if k % 1 == 0:
        break
    i += 1
print(int(k))
Buggy code:
n=int(input())
for i in range(360):
  if (i*n+n)%360==0:
    print(i)
    break

Fixed code:
n=int(input())
for i in range(360):
  if (i*n+n)%360==0:
    print(i+1)
    break
Buggy code:
n=int(input())
for i in range(1, n):
  x=360*i%n
  if x==0:
    print(360*i//n)
    break;
  else:
    continue;

Fixed code:
n=int(input())
for i in range(1, n+1):
  x=360*i%n
  if x==0:
    print(360*i//n)
    break;
  else:
    continue;
Buggy code:
N = int(input())
i = 0
while True:
    i += 1
    if N*i % 360 == 0:
        print(i)

Fixed code:
N = int(input())
i = 0
while True:
    i += 1
    if N*i % 360 == 0:
        print(i)
        break
Buggy code:
x=int(input())
for i in range(1,361):
  if (i*x)%360==0:
    print(i)

Fixed code:
x = int(input())
for i in range(1,361):
  if (i*x)%360 == 0:
    print(i)
    exit()