Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math
n,x = map(int,input().split())
X = list(map(int,input().split()))
X = list(map(lambda a:abs(a-x),X))

def hcf(*x):                                #计算最大公约数
    smaller=min(x)
    for i in reversed(range(1,smaller+1)):
        if list(filter(lambda j: j%i!=0,x)) == []:
            return i
print(hcf(*X))

Fixed submission:
import fractions
n,x = map(int,input().split())
X = list(map(int,input().split()))
X = list(map(lambda a:abs(a-x),X))

for i in range(n):
    if i == 0:
        now = X[i]
    else:
        now = fractions.gcd(X[i], now)

print(now)
Buggy python submission (verdict: Runtime Error):
40
ferelibenterhominesidquodvoluntcredunt

Fixed submission:
n = int(input())
s = str(input())

if len(s) <= n:
    print(s)
else:
    print(s[:n] + "...")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
s = input()[::-1]
mod = 2019

x = [0]

for i, j in enumerate(s):
    x.append((x[-1] + int(j) * pow(10,i))%mod)

C = Counter(x)
ans = 0

for v in C.values():
    ans += v*(v-1)//2
print(ans)

Fixed submission:
from collections import Counter
s = input()[::-1]
mod = 2019

x = [0]

for i, j in enumerate(s):
    x.append((x[-1] + int(j) * pow(10,i, mod))%mod)

C = Counter(x)
ans = 0

for v in C.values():
    ans += v*(v-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
num=int(input())
mod=num%10
if mod==3:
  print('bon')
elif mod==0,1,6,8:
  print('pon')
else:
  print('hon')

Fixed submission:
num=int(input())
mod=num%10
if mod==3:
  print('bon')
elif mod in [0,1,6,8]:
  print('pon')
else:
  print('hon')

Buggy python submission (verdict: Runtime Error):
n=int(input())
mod=n%10
if mod==3:
  print('bon')
elif mod==0,1,6,8:
  print('pon')
else:
  print('hon')


Fixed submission:
num=int(input())
mod=num%10
if mod==3:
  print('bon')
elif mod in [0,1,6,8]:
  print('pon')
else:
  print('hon')

Buggy python submission (verdict: Runtime Error):
num=int(input())
mod=num%10
if mod==3:
  print('bon')
elif mod==0,1,6,8:
  print('pon')
else:
  print('hon')

Fixed submission:
num=int(input())
mod=num%10
if mod==3:
  print('bon')
elif mod in [0,1,6,8]:
  print('pon')
else:
  print('hon')
Buggy python submission (verdict: Runtime Error):
2000000000 0 0 200000000

Fixed submission:
a,b,c,k=map(int,input().split())
if a<=k<=a+b:
  max_value=a
elif k<a:
	max_value=k
else:
  max_value=a*2-k+b
print(max_value)

Buggy python submission (verdict: Runtime Error):
list=list(map(int,input().split()))
a=list[0]
b=list[1]
c=list[2]
k=list[3]
if k=<a+b:
  max_value=a
else:
  max_value=a-k+a+b
print(max_value)


Fixed submission:
a,b,c,k=map(int,input().split())
if a<=k<=a+b:
  max_value=a
elif k<a:
	max_value=k
else:
  max_value=a*2-k+b
print(max_value)

Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
if k=<a+b:
  max_value=a
else:
  max_value=a-k+a+b
print(max_value)


Fixed submission:
a,b,c,k=map(int,input().split())
if a<=k<=a+b:
  max_value=a
elif k<a:
	max_value=k
else:
  max_value=a*2-k+b
print(max_value)

Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input())
if k=<a+b:
  max_value=a
else:
  max_value=a-k+a+b
print(max_value)


Fixed submission:
a,b,c,k=map(int,input().split())
if a<=k<=a+b:
  max_value=a
elif k<a:
	max_value=k
else:
  max_value=a*2-k+b
print(max_value)

Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input())
max_value=0
if k=<a+b:
  max_value=a
elif a+b<k=<a+b+c:
  max_value=a-k+a+b
print(max_value)

Fixed submission:
a,b,c,k=map(int,input().split())
if a<=k<=a+b:
  max_value=a
elif k<a:
	max_value=k
else:
  max_value=a*2-k+b
print(max_value)

Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
max_value=0
if k=<a+b:
  max_value=a
elif a+b<k=<a+b+c:
  max_value=a-k+a+b
print(max_value)

Fixed submission:
a,b,c,k=map(int,input().split())
if a<=k<=a+b:
  max_value=a
elif k<a:
	max_value=k
else:
  max_value=a*2-k+b
print(max_value)

Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split)
max_value=0
if k=<a+b:
  max_value=a
elif a+b<k=<a+b+c:
  max_value=a-k+a+b
print(max_value)

Fixed submission:
a,b,c,k=map(int,input().split())
if a<=k<=a+b:
  max_value=a
elif k<a:
	max_value=k
else:
  max_value=a*2-k+b
print(max_value)
Buggy python submission (verdict: Runtime Error):
contest=input()
if contest='ABC':
  print('ARC')
elif contest='ARC':
  print('ABC')
else:
  print('Error')

Fixed submission:
contest=input()
if contest=='ABC':
  print('ARC')
elif contest=='ARC':
  print('ABC')
else:
  print('Error')
Buggy python submission (verdict: Runtime Error):
k=int(input())
a,b=map(int,input.split())
list=range(a,b+1)
for val in list:
  if val%k==0:
    print('OK')
    break
  else:
    print('NG')
    continue
    
  

Fixed submission:
k=int(input())
p=0
a,b=map(int,input().split())
list=list(range(a,b+1))
for val in list:
  if val%k==0:
    print('OK')
    p+=1
    break
  else:
    continue

if p==0:
  print('NG')
Buggy python submission (verdict: Runtime Error):
X=int(input())
trial=0
p=100
while p<=x:
  trial+=1
  p=p*1.01
print(trial)

Fixed submission:
import math

x=int(input())
trial=0
p=100
while p<x:
  trial+=1
  p=p*1.01
  p=math.floor(p)
print(trial)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
while a,b>0:
  c-=b
  a-=d
if a<=0,b>0:
  print('No')
elif b<=0:
  print('Yes')

Fixed submission:
a,b,c,d=map(int,input().split())
while a>0 and b>0:
  c-=b
  a-=d
if a<=0 and c>0:
  print('No')
elif c<=0:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
import math
pi=math.pi
r=int(input())
len=2*pi*r
return len


Fixed submission:
import math
pi=math.pi
r=int(input())
len=2*pi*r
print(len)

Buggy python submission (verdict: Runtime Error):
import math
pi=math.pi()
r=int(input())
len=2*pi*r
print(len)


Fixed submission:
import math
pi=math.pi
r=int(input())
len=2*pi*r
print(len)

Buggy python submission (verdict: Runtime Error):
import math
pi=math.pi()
r=int(input())
len=2*pi*r
return len

Fixed submission:
import math
pi=math.pi
r=int(input())
len=2*pi*r
print(len)
Buggy python submission (verdict: Runtime Error):
a = input()
b = a - a // 10 * 10
c = ("pon" if b == 0 else
     "pon" if b == 1 else
     "hon" if b == 2 else
     "bon" if b == 3 else
     "hon" if b == 4 else
     "hon" if b == 5 else
     "pon" if b == 6 else
     "hon" if b == 7 else
     "pon" if b == 8 else
     "hon" if b == 9 else
     ""
     )
print(c)

Fixed submission:
a = int(input())
b = a - a // 10 * 10
c = ("pon" if b == 0 else
     "pon" if b == 1 else
     "hon" if b == 2 else
     "bon" if b == 3 else
     "hon" if b == 4 else
     "hon" if b == 5 else
     "pon" if b == 6 else
     "hon" if b == 7 else
     "pon" if b == 8 else
     "hon" if b == 9 else
     ""
     )
print(c)
Buggy python submission (verdict: Runtime Error):
H, A = int(input().split())
i = 1

for j in range(10000):
  # i 回目の攻撃
  H = H - A
  
  # HP判定
  if H <= 0:
    i = i
  else:
    i = i + 1

# 何回攻撃すればよいか
if H <= 0:
  print(i)

Fixed submission:
H, A = map(int, input().split())
i = 1

for j in range(10000):
    H = H - A
    if H <= 0:
        i = i
    else:
        i = i + 1
if H <= 0:
    print(i)

Buggy python submission (verdict: Runtime Error):
H = input()
A = input()

i = 1

# 1回目の攻撃
for j in range(10000):
    H = H - A
    if H < 0 :
      print(i)
    else:
      i = i + 1

Fixed submission:
H, A = map(int, input().split())
i = 1

for j in range(10000):
    H = H - A
    if H <= 0:
        i = i
    else:
        i = i + 1
if H <= 0:
    print(i)
Buggy python submission (verdict: Runtime Error):
N,M,X = map(int,input().split())

A =  []
S = [0 for _ in range(N)] 
min_value = 0 
score=[0 for _ in range(N)] 

for x in range(N):
  A.append(list(map(int,input().split())))

for x in range(N):
  min_value += A[x][0]
  
sucess = 0

for bit in range(2**N):
  for i in range(N):
    if (bit >> i) & 1:
      S.append(A[i][0])
      for x in range(M):
        score[x] += A[i][x+1]
  flag = 0

  for k in score:
    if k >= 10:
      flag += 1
    if flag ==len(score):
      if min_value >= sum(S):
        min_value = sum(S)
        sucess += 1 
        
  score=[0 for _ in range(N)]
  S =[]
  
if sucess > 0:
	print(min_value)
else:
  print("-1")

Fixed submission:
N,M,X = map(int,input().split())

A =  []
S = [0 for _ in range(N)] 
min_value = 0 
score=[0 for _ in range(M)] 

for x in range(N):
  A.append(list(map(int,input().split())))

for x in range(N):
  min_value += A[x][0]


sucess = 0

for bit in range(2**N):
  for i in range(N):
    if (bit >> i) & 1:
      S.append(A[i][0])
      for x in range(M):
        score[x] += A[i][x+1]
  flag = 0
  #print(score)
  for k in score:
    if k >= X:
      flag += 1
    if flag ==len(score):
      #print("S",S)
      if min_value >= sum(S):
        min_value = sum(S)
        sucess += 1 
        
  score=[0 for _ in range(M)]
  S =[]
  
if sucess > 0:
	print(min_value)
else:
  print("-1")
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())
while True:
  A -= D
  C -= B
  if A < 0:
    print("No"):
    break
  if C < 0:
    print("Yes")
    break

Fixed submission:
A,B,C,D = map(int,input().split())
while True:
  C -= B
  if C <= 0:
    print("Yes")
    break
  A -= D
  if A <= 0:
    print("No")
    break
Buggy python submission (verdict: Time Limit Exceeded):
N, Y = map(int, input().split())
sum = [a*10000+b*5000+(N-a-b)*1000 for a in range(N+1) for b in range(N-a+1)]
pairs = [[a, b, N-a-b] for a in range(N+1) for b in range(N-a+1)]

if Y in sum:
    candidate = pairs[sum.index(Y)]
    print(' '.join(map(str, candidate)))
else:
    print("-1 -1 -1")

Fixed submission:
N, Y = map(int, input().split())
pairs = [[a, b, N-a-b] for a in range(N+1) for b in range(N-a+1) if a*10000+b*5000+(N-a-b)*1000 == Y]

if len(pairs) != 0:
    print(" ".join(map(str, pairs[0])))
else:
    print("-1 -1 -1")
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K = map(int,input().split())
score = 0
for i in range(K):
    if A != 0:
        score += 1
        A -= 1
    elif B!= 0:
        B -= 1
    else:
        score -= 1
print(score)

Fixed submission:
A,B,C,K = map(int,input().split())
score = 0
if A <= K:
    K -= A
    if B <= K:
        K -= B
        print(A-K)
    else:
        print(A)
    
else:
    print(K)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
num = [0 for i in range(N)]
zu = []
ans = []
for i in A:
    num[i-1]+=1
for i in range(N):
    temp = 1/2*num[i]*(num[i]-1)
    zu.append(int(temp))
for i in A:
    num[i-1]-=1
    temp = zu[i-1]
    zu[i-1] = 1/2*num[i-1]*(num[i-1]-1)
    print(int(sum(zu)))
    zu[i-1] = temp
    num[i-1]+=1


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
num = [0 for i in range(N)]
zu = 0
ans = []
for i in A:
    num[i-1]+=1
for i in range(N):
    temp = 1/2*num[i]*(num[i]-1)
    zu += temp
for i in A:
    kawari =zu
    temp1 = 1/2*num[i-1]*(num[i-1]-1)
    num[i-1] -= 1
    temp2 = 1/2*num[i-1]*(num[i-1]-1)
    kawari += -temp1+temp2
    num[i-1] += 1
    print(int(kawari))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
num = [0 for i in range(N)]
zu = []
ans = []
for i in A:
    num[i-1]+=1
sums = 0
for i in range(N):
    temp = 1/2*num[i]*(num[i]-1)
    zu.append(int(temp))
for i in A:
    num[i-1]-=1
    temp = zu[i-1]
    zu[i-1] = 1/2*num[i-1]*(num[i-1]-1)
    ans.append(int(sum(zu)))
    zu[i-1] = temp
    num[i-1]+=1

for i in range(N):
    print(ans[i])

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
num = [0 for i in range(N)]
zu = 0
ans = []
for i in A:
    num[i-1]+=1
for i in range(N):
    temp = 1/2*num[i]*(num[i]-1)
    zu += temp
for i in A:
    kawari =zu
    temp1 = 1/2*num[i-1]*(num[i-1]-1)
    num[i-1] -= 1
    temp2 = 1/2*num[i-1]*(num[i-1]-1)
    kawari += -temp1+temp2
    num[i-1] += 1
    print(int(kawari))
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
Q = int(input())
spin = False
S_mae = []
for i in range(Q):
    temp = list(input().split())
    if temp[0] == "1":
        spin = not spin
    else:
        if spin:
            if temp[1] == "1":
                S.append(temp[2])
            else:
                S_mae.append(temp[2])
        else:
            if temp[1] == "1":
                S_mae.append(temp[2])
            else:
                S.append(temp[2])

res = ""
if spin:
    for i in range(len(S)):
        res += S.pop()
    res += "".join(S_mae)
else:
    for i in range(len(S_mae)):
        res += S_mae.pop()
    res += "".join(S)
print(res)


Fixed submission:
import collections
S = collections.deque(list(input()))
Q = int(input())
spin = False
for i in range(Q):
    temp = list(input().split())
    if temp[0] == "1":
        spin = not spin
    else:
        if spin:
            if temp[1] == "1":
                S.append(temp[2])
            else:
                S.appendleft(temp[2])
        else:
            if temp[1] == "1":
                S.appendleft(temp[2])
            else:
                S.append(temp[2])

res = ""
if spin:
    S.reverse()
    print("".join(S))
else:
    print("".join(S))
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
N_list = [0]*N
flg_list  = [0]*N
flg = False
for i in range(M):
    s,c = map(int,input().split())
    if flg_list[s-1] == 0:
        N_list[s-1] = c
        flg_list[s-1] = 1
    elif N_list[s-1] != c:
        flg = True
        break
res = 0
for i in range(N-1,-1,-1):
    res += 10**i * N_list[N-1-i]

if N = 1:
    print(res)
elif flg or (N_list[0] == 0 and flg_list[0] == 1):
    print("-1")
elif N == len(str(res)):
    print(res)
else:
    print(res+10**(N-1))


Fixed submission:
N,M = map(int,input().split())
N_list = [0]*N
flg_list  = [0]*N
flg = False
for i in range(M):
    s,c = map(int,input().split())
    if flg_list[s-1] == 0:
        N_list[s-1] = c
        flg_list[s-1] = 1
    elif N_list[s-1] != c:
        flg = True
        break
res = 0
for i in range(N-1,-1,-1):
    res += 10**i * N_list[N-1-i]

if N == 1 and not flg:
    print(res)
elif flg or (N_list[0] == 0 and flg_list[0] == 1):
    print("-1")
elif N == len(str(res)):
    print(res)
else:
    print(res+10**(N-1))
Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split())
if 500*k >= X:
    print("Yes")
else:
    print("No")

Fixed submission:
K,X = map(int,input().split())
if 500*K >= X:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
A,B = map(int,input().split())
print(int((A*B)/math.gcd(A,B)))

Fixed submission:
import fractions
A,B = map(int,input().split())
print(int((A*B)/fractions.gcd(A,B)))

Buggy python submission (verdict: Runtime Error):
import math
A,B = map(int,input().split())
print((A*B)//math.gcd(A,B))

Fixed submission:
import fractions
A,B = map(int,input().split())
print(int((A*B)/fractions.gcd(A,B)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = list(map(int,input().split()))
M = dict(zip(range(1,N+1),K))
M = sorted(M.items(), key = lambda x:x[1])
newM = []
for i in M:
  newM.append(i[0])
print(+newM)

Fixed submission:
N = int(input())
K = list(map(int,input().split()))
M = dict(zip(range(1,N+1),K))
M = sorted(M.items(), key = lambda x:x[1])
newM = []
for i in M:
  newM.append(i[0])
print(*newM)
Buggy python submission (verdict: Runtime Error):
N = int(input())

if N[-1] == '2':
  print 'hon'
elif N[-1] == '4':
  print'hon'
elif N[-1] == '5':
  print'hon'
elif N[-1] == '7':
  print 'hon'
elif N[-1] == '9':
   print'hon'
elif N[-1] == '3':
   print'bon'
else:
   print'pon'

Fixed submission:
N = str(int(input()))

if N[-1] == '2':
  print('hon')
elif N[-1] == '4':
  print('hon')
elif N[-1] == '5':
  print('hon')
elif N[-1] == '7':
  print ('hon')
elif N[-1] == '9':
   print('hon')
elif N[-1] == '3':
   print('bon')
else:
   print('pon')
Buggy python submission (verdict: Time Limit Exceeded):
import datetime

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result


arr_data = getinputdata()

x = int(arr_data[0][0])
y = int(arr_data[0][1])


cnt=1

if x // y>=1 and x % y==0:
    
    print(-1)

else:
    while cnt<10**18:

        if cnt%x==0 and cnt%y!=0:

            print(cnt)
            break

        else:
            cnt+=1
            
#print(-1)



Fixed submission:
import datetime

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result


arr_data = getinputdata()

x = int(arr_data[0][0])
y = int(arr_data[0][1])


cnt = 1
#
#if x // y>=1 and x % y==0:
#    
#    print(-1)
#
#else:
#    while cnt<10**18:
#
#        if cnt%x==0 and cnt%y!=0:
#
#            print(cnt)
#            break
#
#        else:
#            cnt+=1
#            
##print(-1)
#

if x // y >= 1 and x % y == 0:
    
    print(-1)
else:
    for i in range(x, 10 ** 18, x):

        if i % y != 0:

            print(i)
            break

    else:

        print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
arr=[int(x) for x in arr_data[1]]

m = int(arr_data[2][0])
arr_problem=[int(x) for x in arr_data[3]]

chkflg=True

for v in arr_problem:
    
    if v in arr:
        
        arr.pop(arr.index(v))
    else:
        
        chkflg=False
        break
        
        
print("YES" if chkflg else "NO")

Fixed submission:
from collections import defaultdict
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
arr=[int(x) for x in arr_data[1]]

numbers = defaultdict(lambda: 0)
for v in arr:
    numbers[v] += 1
hash01=dict(numbers)

m = int(arr_data[2][0])
arr_problem=[int(x) for x in arr_data[3]]

numbers_problem = defaultdict(lambda: 0)
for v in arr_problem:
    numbers_problem[v] += 1
hash02=dict(numbers_problem)

chkflg=True

for k,v in hash02.items():
    
    if not k in hash01 or v>hash01[k]:
    
        chkflg=False
    
print("YES" if chkflg else "NO")
Buggy python submission (verdict: Runtime Error):
import fractions
import math
from functools import reduce
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

def lcm(*args):
    return reduce(lambda a,b: a * b // math.gcd(a, b), args)

arr_data = getinputdata()

n = int(arr_data[0][0])

arr=[int(arr_data[i][0]) for i in range(1,1+n)]

print(lcm(*tuple(arr)))



Fixed submission:
import fractions
import math
from functools import reduce
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

def lcm(*args):
    return reduce(lambda a,b: a * b // fractions.gcd(a, b), args)

arr_data = getinputdata()

n = int(arr_data[0][0])

arr=[int(arr_data[i][0]) for i in range(1,1+n)]

print(lcm(*tuple(arr)))
Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = True

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:


        return array_result

arr_data = getinputdata()

#島数
n = arr_data[0][0]
m = int(arr_data[0][1])

arr01 = []
arr02 = []
for i in range(1, 1 + m):

    if arr_data[i][0] == "1":
        
        arr01.append(arr_data[i][1])

    if arr_data[i][1] == n:
        
        arr02.append(arr_data[i][0])

chkflg = False
for v in arr01:
    
    if v in arr02:
        
        chkflg = True
        break
        
print("POSSIBLE" if chkflg else "IMPOSSIBLE")

Fixed submission:
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = True

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:


        return array_result

arr_data = getinputdata()

#島数
n = arr_data[0][0]
m = int(arr_data[0][1])

arr01 = []
arr02 = []
for i in range(1, 1 + m):

    if arr_data[i][0] == "1":
        
        arr01.append(arr_data[i][1])

    if arr_data[i][1] == n:
        
        arr02.append(arr_data[i][0])


print("POSSIBLE" if len(list(set(arr01) & set(arr02))) == 1 else "IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = True

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:


        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

sumdata = 0

for v in list01:
    
    sumdata += abs(v)

mytotal = 0

for v in list(map(int, arr_data[1])):
    
    if mytotal + v > sumdata // 2:
        
        break
        
    else:
        
        mytotal += v
        
print(sumdata-mytotal-mytotal)
    


Fixed submission:
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = True

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:


        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
list01 = [int(x) for x in arr_data[1]]

sumdata = sum(list01)

middledata = sumdata // 2
#初期値
x = list01[0]
y = sumdata-x
temp=abs(x-y)

for i in range(1, n-1):

    x += list01[i]
    y = sumdata-x
    
    if temp>abs(x-y):
        
        temp=abs(x-y)
        
        
print(temp)