Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#Bad_Beast
n=int(input())
if n==111:
    print(111)
if n>111 and n<=222:
    print(222)
elif n>222 and n<=333:
    print(333)
elif n>333 and n<=444:
    print(444)
elif n>444 and n<=555:
    print(555)
elif n>555 and n<=666:
    print(666)
elif n>666 and n<=777:
    print(777)
elif n>777 and n<=888:
    print(888)
elif n>888 and n<=999:
    print(999)
print(res)    
        
    

Fixed submission:
#Bad_Beast
n=int(input())
if n>=100 and n<=111:
    print(111)
if n>111 and n<=222:
    print(222)
elif n>222 and n<=333:
    print(333)
elif n>333 and n<=444:
    print(444)
elif n>444 and n<=555:
    print(555)
elif n>555 and n<=666:
    print(666)
elif n>666 and n<=777:
    print(777)
elif n>777 and n<=888:
    print(888)
elif n>888 and n<=999:
    print(999)
#print(res)
Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
if k==1:
    print(s[0])
else:
    if s[0]=="1":
        if k < =(10**18):
            print(s[1])
        else:
            print(s[2])
    else:
        if k < =(10**18):
            print(s[0])
        else:
            print(s[1])
            

Fixed submission:
a,b=list(map(int,input().split()))
area=(a*b)-(a+b-1)
print(area)
Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())

if k==1:
    print(s[0])
elif s[0]=="1" and s[1]=="1":
    if s[2]=="1":    
        if k<3:
            print("1")
        else:
            print(s[3])
    else:
        if k<2:
            print("1")
        else:
            print(s[2])
elif s[1]!="1" and s[2]!=1:
    if s[0]=="1" :
        if k <= (10**18):
            print(s[1])
        else :
            print(s[2])
    else:
        if k <= (10**18):
            print(s[0])
        else:
            print(s[1])
            

Fixed submission:
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]=="1":
        k-=1
    else:
        k=0
    if k<=0:
        print(s[i])
        break

Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())

if k==1:
    print(s[0])
    
else:
    for i in range(len(s)):
        if s[i]!="1":
            break
    if i!=1 and k<=i:
        print(1)
    elif i!=1 and k>i:    
        print(s[i+1])
        
    elif s[0]=="1" and s[1]!="1":
        if k <= (10**18):
            print(s[1])
        else :
            print(s[2])
    else:
        if k <= (10**18):
            print(s[0])
        else:
            print(s[1])
            

Fixed submission:
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]=="1":
        k-=1
    else:
        k=0
    if k<=0:
        print(s[i])
        break
Buggy python submission (verdict: Runtime Error):
# cook your dish here
n,k=list(map(int,input().split()))
if n%k==0:
    print(n%k)
else:
    a=[]
    x=int(n/k)
    for i in range(1,x+1):
        r=n-(i*(k-1))
        a.append(abs(r-i))   
    print(min(a))    
    

Fixed submission:
# cook your dish here
n,k=list(map(int,input().split()))
if n%k==0:
    print(0)
else:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
# cook your dish here
# cook your dish here
n=int(input())
if n%4==0:
    print("Yes")
elif n%7==0:
    print("Yes")
else:
    p=1
    t=True
    while p<26:
        if (n-(4*p))%7 ==0:
            t=False
            print("Yes")
            break
    if t:
        print("No")


Fixed submission:
n=int(input())
p=0
t=True
while p<26:
    r=n-(7*p)
    if r>=0 and r%4 ==0:
        t=False
        print("Yes")
        break
    p+=1
if t:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
# cook your dish here
n=int(input())
if n%4==0:
    print("Yes")
elif n%7==0:
    print("Yes")
else:
    p=1
    t=True
    while p<100:
        if (n-(4*p))%7 ==0:
            t=False
            print("Yes")
            break
    if t:
        print("No")

Fixed submission:
n=int(input())
p=0
t=True
while p<26:
    r=n-(7*p)
    if r>=0 and r%4 ==0:
        t=False
        print("Yes")
        break
    p+=1
if t:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int,input().split())
S = input()
field = {s:[] for s in S}
golem = [1 for i in range(N)]
for i in range(N):
    field[S[i]].append(i)
del_num = 0
for i in range(Q):
    t, d = input().split()
    div = 1 if d == "R" else -1
    if not t in field:
        continue
    for f in field[t]:

        if golem[f] >0:
            if f + div >= 0 and f + div < N:
                golem[f+div] += golem[f]
            golem[f] = 0
print(sum(golem))

Fixed submission:
def sim(i):
    for t, d in qs:
        if S[i] == t:
            div = 1 if d == "R" else -1
            i += div
            if i == 0:
                return 0
            elif i == N+1:
                return N+1
    return i

def bin_search_left():
    ok = 0
    ng = N+1

    while abs(ok-ng)>1:
        mid = (ok+ng) //2
        res = sim(mid)
        #print(ok,ng,mid,res)
        if res == 0:
            ok = mid
        if res >0:
            ng = mid
    return ok


def bin_search_right():
    ng = 0
    ok = N+1

    while abs(ok-ng)>1:
        mid = (ok+ng) //2
        res = sim(mid)
        #print(ok,ng,mid,res)
        if res < N+1:
            ng = mid
        if res >= N+1:
            ok = mid
    return ok


N, Q = map(int,input().split())
S = "0"+input()+"0"
qs = []
for _ in range(Q):
    t, d = input().split()
    qs.append((t,d))

L = bin_search_left()
R = bin_search_right()
print(N-L-(N+1-R))
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int,input().split())
S = input()



memo = {}
def init_memo():
    for start in range(N):
        for end in range(start,N):
            if start == end == 0:
                memo[(start,end)] = 0
            elif start == end:
                memo[(start,end)] = memo[(start-1,end)] - int(S[start-1:start+1]=="AC")
            else:
                memo[(start, end)] = memo[(start,end-1)] + int(S[end-1:end+1] == "AC")

init_memo()

for _ in range(Q):
    l, r = map(int,input().split())
    print(memo[(l-1,r-1)])

Fixed submission:
N, Q = map(int,input().split())
S = input()
memo = [0 for _ in [0]*(N+1)]
for i in range(2,N+1):
    memo[i] = memo[i-1] + int(S[i-2:i]=="AC")
for _ in range(Q):
    l, r = map(int,input().split())
    print(memo[r]-memo[l])

Buggy python submission (verdict: Time Limit Exceeded):
import re
N, Q = map(int,input().split())
S = input()
for _ in range(Q):
    l, r = map(int,input().split())
    res = re.findall("AC",S[l-1:r])
    print(0 if len(res)==0 else len(res))

Fixed submission:
N, Q = map(int,input().split())
S = input()
memo = [0 for _ in [0]*(N+1)]
for i in range(2,N+1):
    memo[i] = memo[i-1] + int(S[i-2:i]=="AC")
for _ in range(Q):
    l, r = map(int,input().split())
    print(memo[r]-memo[l])
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

dp = np.zeros((N+1,4,4,4),dtype="int")

dp[0,3,3,3] = 1
mod = 10**9+7


for l in range(N):
    for c1 in range(4):
        for c2 in range(4):
            for c3 in range(4):
                if dp[l,c3,c2,c1] == 0:
                    continue
                for c0 in range(4):
                    if c0 == 1 and c1 == 2 and c2 == 0:
                        continue
                    if c0 == 2 and c1 == 1 and c2 == 0:
                        continue
                    if c0 == 2 and c1 == 0 and c2 == 1:
                        continue
                    if c0 == 2 and c1 == 1 and c3 == 0:
                        continue
                    if c0 == 2 and c2 == 1 and c3 == 0:
                        continue
                    dp[l+1,c2,c1,c0] += dp[l,c3,c2,c1]
                    dp[l + 1, c2, c1, c0] %= mod
                    
ans = 0
for c1 in range(4):
    for c2 in range(4):
        for c3 in range(4):
            ans += dp[N,c3,c2,c1]
            ans %= mod
print(ans%mod)

Fixed submission:
import numpy as np
N = int(input())

dp = np.zeros((N+1,4,4,4),dtype="int")

dp[0,3,3,3] = 1
mod = 10**9+7


for l in range(N):
    for c1 in range(4):
        for c2 in range(4):
            for c3 in range(4):
                if dp[l,c3,c2,c1] == 0:
                    continue
                for c0 in range(4):
                    if c0 == 1 and c1 == 2 and c2 == 0:
                        continue
                    if c0 == 2 and c1 == 1 and c2 == 0:
                        continue
                    if c0 == 2 and c1 == 0 and c2 == 1:
                        continue
                    if c0 == 2 and c1 == 1 and c3 == 0:
                        continue
                    if c0 == 2 and c2 == 1 and c3 == 0:
                        continue
                    dp[l+1,c2,c1,c0] += dp[l,c3,c2,c1]
                    dp[l + 1, c2, c1, c0] %= mod
                    
ans = 0
for c1 in range(4):
    for c2 in range(4):
        for c3 in range(4):
            ans += dp[N,c3,c2,c1]
            ans %= mod
print(ans%mod)
Buggy python submission (verdict: Runtime Error):
memo = {}
def solve(S):
    if len(S)<1:
        return 0
    crs = 0
    if S in memo:
        return memo[S]
    while crs + 1 < len(S):
        if S[crs] != S[crs+1]:
            memo[S] = solve(S[:crs]+S[crs+2:])+2
            return memo[S]
        crs += 1
    return 0
S = input()
print(solve(S))

Fixed submission:
def solve(S):
    return min(S.count("0"),S.count("1"))*2
  
S = input()
print(solve(S))

Buggy python submission (verdict: Runtime Error):
def solve(S,crs=0):
    if crs >= len(S) or crs <0:
        return 0
    while crs + 1 < len(S):
        if S[crs] != S[crs+1]:
            #print(S,crs)
            return max(solve(S,crs+1),solve(S[:crs]+S[crs+2:],crs-1)+2)
        crs += 1
        
    return 0
  
S = input()
print(solve(S,0))

Fixed submission:
def solve(S):
    return min(S.count("0"),S.count("1"))*2
  
S = input()
print(solve(S))

Buggy python submission (verdict: Runtime Error):
def solve(S,crs=0):
    if crs >= len(S):
        return 0
    while crs + 1 < len(S):
        if S[crs] != S[crs+1]:
            return max(solve(S,crs+1),solve(S[:crs]+S[crs+2:],crs-1)+2)
        crs += 1
        
    return 0
  
S = input()
print(solve(S,0))

Fixed submission:
def solve(S):
    return min(S.count("0"),S.count("1"))*2
  
S = input()
print(solve(S))
Buggy python submission (verdict: Runtime Error):
import math

N,A,B,C = map(int,input().split())
target = [A,B,C]
l = []
#ans = math.inf

for _ in range(N):
    l.append(int(input()))


def calc2(v):
    res = 0
    for i in range(3):
        if len(v[i])==0:
            return math.inf
        res += 10*(len(v[i])-1) + abs(sum(v[i]) - target[i])
    return res

v=[[],[],[],[]]
def dfs2(depth=0):
    #global ans
    if depth == N:
        return calc2(v)
    #else:
    ans = math.inf
    for i in range(4):
        #next_v = v.copy()
        #print(i, v, depth, l)
        v[i].append(l[depth])
        ans = min(ans,dfs2(depth+1))
        del v[i][-1]

    return ans
print(dfs2())

Fixed submission:
import numpy as np

N,A,B,C = map(int,input().split())
target = [A,B,C]
l = []
#ans = math.inf

for _ in range(N):
    l.append(int(input()))


def calc2(v):
    res = 0
    for i in range(3):
        if len(v[i])==0:
            return np.inf
        res += 10*(len(v[i])-1) + abs(sum(v[i]) - target[i])
    return res

v=[[],[],[],[]]
def dfs2(depth=0):
    #global ans
    if depth == N:
        return calc2(v)
    #else:
    ans = np.inf
    for i in range(4):
        #next_v = v.copy()
        #print(i, v, depth, l)
        v[i].append(l[depth])
        ans = min(ans,dfs2(depth+1))
        del v[i][-1]

    return ans

print(dfs2())
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = list(map(int, input().split()))

ans = 10**10
for i in range(N-1):
    ans = min(ans, math.gcd(A[i],A[i+1]))
print(ans)

Fixed submission:
import fractions
N = int(input())
A = list(map(int, input().split()))

ans = 10**10
for i in range(N-1):
    ans = min(ans, fractions.gcd(A[i],A[i+1]))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = list(map(int, input().split()))

ans = 10**10
for i in range(N-1):
    ans = min(ans, math.gcd(A[i],A[i+1]))
print(ans)

Fixed submission:
import fractions
N = int(input())
A = list(map(int, input().split()))

ans = 10**10
for i in range(N-1):
    ans = min(ans, fractions.gcd(A[i],A[i+1]))
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = list(map(int, input().split()))

cost = [2,5,5,4,5,6,3,7,6]


def solve(N, num=0):
    if N < 0:
        return -1
    if N == 0:
        return num
    ans = 0
    for a in A:
        tmp_num = num
        if tmp_num == 0:
            tmp_num += a
        else:
            tmp_num += a*(10**len(str(tmp_num)))
        ans = max(solve(N-cost[a-1],tmp_num),ans)
    return ans

print(solve(N))

Fixed submission:
N, M = map(int,input().split())
A = list(map(int, input().split()))
cost = [2,5,5,4,5,6,3,7,6]

dp = [-1 for _ in [0]*(N+10)]
dp[0] = 0

for i in range(N+1):
    for a in A:
        if i-cost[a-1] < 0 or dp[i-cost[a-1]] < 0:
            continue
        if dp[i-cost[a-1]]*10 + a > dp[i]:
            dp[i] = dp[i-cost[a-1]]*10 + a
print(dp[N])
Buggy python submission (verdict: Runtime Error):
N = int(input())
prev = [0,0,0]
now = [0,0,0]
for i in range(N):
    acts = list(map(int,input().split()))
    for pi in range(3):
        for ni in range(3):
            if pi == ni:
                continue
            now[ni] = max(now[ni], prev[pi]+acts[ni])
    prev = now.copy()
print(max(now))

Fixed submission:
N = int(input())
prev = [0,0,0]
now = [0,0,0]
for i in range(N):
    acts = list(map(int,input().split()))
    for pi in range(3):
        for ni in range(3):
            if pi == ni:
                continue
            now[ni] = max(now[ni], prev[pi]+acts[ni])
    prev = now.copy()
print(max(now))

Buggy python submission (verdict: Runtime Error):
N = int(input())
prev = [0,0,0]
now = [0,0,0]
for i in range(N):
    acts = list(map(int,input().split()))
    for pi in range(3):
        for ni in range(3):
            if pi == ni:
                continue
            now[ni] = max(now[ni], prev[pi]+acts[ni])
    prev = now.copy()
print(max(now))

Fixed submission:
N = int(input())
prev = [0,0,0]
now = [0,0,0]
for i in range(N):
    acts = list(map(int,input().split()))
    for pi in range(3):
        for ni in range(3):
            if pi == ni:
                continue
            now[ni] = max(now[ni], prev[pi]+acts[ni])
    prev = now.copy()
print(max(now))
Buggy python submission (verdict: Time Limit Exceeded):
N,A,B = map(int,raw_input().split())
monsters = [0 for _ in xrange(N)]
for i in xrange(N):
    monsters[i] = int(raw_input())
cnt = 0
while(True):
    m = max(monsters)
    if m <=0:
        break
    midx = monsters.index(m)
    #print midx
    monsters[midx] -= A
    #print monsters
    
    for i in xrange(N):
        if i != midx:
            monsters[i] -= B
    cnt += 1
print cnt
    

Fixed submission:
import sys
import math
input = sys.stdin.readline
N, A, B = map(int, input().split())
h_list = []
for _ in range(N):
    h_list.append(int(input()))

def compare(k):
    cnt = 0
    for h in h_list:
        tmp_h = h - k*B
        x = max(math.ceil(tmp_h/(A-B)),0)
        cnt += x
        if cnt > k:
            return False
    return True
def solve():
    ng = 0
    ok = math.ceil(max(h_list) / B)
    while abs(ok-ng) > 1:
        mid = (ng + ok) // 2
        res = compare(mid)
        if (res):
            ok = mid
        else:
            ng = mid
    return ok
print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,raw_input().split(' '))
arr = []
a_count = {}
for i in xrange(n):
    a,b = map(int,raw_input().split(' '))
    if not a in arr:
        arr.append(a)
        a_count.update({a:b})
    else:
        a_count[a] += b
        
        
arr.sort()
cnt = 0

for i in arr:
    cnt += a_count[i]
    if k <=cnt:
        print i
        break



Fixed submission:
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
array = [0]*(10**5+1)
for _ in range(N):
    a, b = map(int, input().split())
    array[a] += b
ans = 0
for i in range(10**5+1):
    K -= array[i]
    if K<= 0:
        ans = i
        break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,raw_input().split(' '))
arr = []
for i in xrange(n):
    a,b = map(int,raw_input().split(' '))
    for _ in xrange(b):
        arr.append(a)
arr.sort()
print arr[k-1]



Fixed submission:
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
array = [0]*(10**5+1)
for _ in range(N):
    a, b = map(int, input().split())
    array[a] += b
ans = 0
for i in range(10**5+1):
    K -= array[i]
    if K<= 0:
        ans = i
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline

N, M = map(int, input().split())
a = [0]*N
b = [0]*N
c = [0]*N
for i in range(M):
    a[i], b[i], c[i] = map(int, input().split())
    a[i] -=1
    b[i] -=1

MAX = 10**10
dist = np.zeros((N,N))
dist += MAX

for i in range(N):
    dist[i,i] = 0

for i in range(M):
    dist[a[i], b[i]] = c[i]
    dist[b[i], a[i]] = c[i]

for k in range(N):
    for i in range(N):
        for j in range(N):
            dist[i, j] = min(dist[i,j], dist[i,k] + dist[k,j])

ans = 0
for i in range(M):
    if dist[a[i], b[i]] < c[i]:
        ans += 1

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [0]*M
b = [0]*M
c = [0]*M
for i in range(M):
    input_data = input().split()
    a[i], b[i], c[i] = map(int, input_data)
    a[i] -=1
    b[i] -=1

MAX = 10**10
dist = [[MAX for j in range(N)] for i in range(N)]
#dist += MAX

for i in range(N):
    dist[i][i] = 0

for i in range(M):
    dist[a[i]][b[i]] = c[i]
    dist[b[i]][a[i]] = c[i]

for k in range(N):
    for i in range(N):
        for j in range(N):
            dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

ans = 0
for i in range(M):
    if dist[a[i]][b[i]] < c[i]:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [0]*N
b = [0]*N
c = [0]*N
for i in range(M):
    a[i], b[i], c[i] = map(int, input().split())
    a[i] -=1
    b[i] -=1

MAX = 10**10
dist = [[MAX for j in range(N)] for i in range(N)]

for i in range(N):
    dist[i][i] = 0

for i in range(M):
    dist[a[i]][b[i]] = c[i]
    dist[b[i]][a[i]] = c[i]

for k in range(N):
    for i in range(N):
        for j in range(N):
            dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

ans = 0
for i in range(M):
    if dist[a[i]][b[i]] < c[i]:
        ans += 1

print(ans)


Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [0]*M
b = [0]*M
c = [0]*M
for i in range(M):
    input_data = input().split()
    a[i], b[i], c[i] = map(int, input_data)
    a[i] -=1
    b[i] -=1

MAX = 10**10
dist = [[MAX for j in range(N)] for i in range(N)]
#dist += MAX

for i in range(N):
    dist[i][i] = 0

for i in range(M):
    dist[a[i]][b[i]] = c[i]
    dist[b[i]][a[i]] = c[i]

for k in range(N):
    for i in range(N):
        for j in range(N):
            dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

ans = 0
for i in range(M):
    if dist[a[i]][b[i]] < c[i]:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
string = input()
numlist = [int(n) for n in string]
fst = numlist[0] * 10 + numlist[1]
scd = numlist[2] * 10 + numlist[3]
 
  
if string == '0000':
    print('NA')
    
elif fst > 12:
    if scd > 12:
        print('NA')
    else:
      	print('YYMM')
else:
    if scd > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Fixed submission:
nk_str = input()
string = input()
nk_list = nk_str.split()
k = int(nk_list[-1])
string_list = [c for c in string]
string_list[k - 1] = string_list[k - 1].lower()
string = ''.join(string_list)
print(string)

Buggy python submission (verdict: Runtime Error):
nk_str = input()
string = input()
nk_list = nk_str.split()
k = int(nk_list[-1])
char_list = [c for c in string]
char_list[k - 1] = char_list[k - 1].lower()
string = ''.join(string_list)
print(string

Fixed submission:
nk_str = input()
string = input()
nk_list = nk_str.split()
k = int(nk_list[-1])
string_list = [c for c in string]
string_list[k - 1] = string_list[k - 1].lower()
string = ''.join(string_list)
print(string)

Buggy python submission (verdict: Runtime Error):
nk_str = input()
string = input()
nk_list = nk_str.split()
k = int(nk_list[-1])
string_list = string.split()
string_list[k - 1] = string_list[k - 1].lower()
string = ''.join(string_list)
print(string)

Fixed submission:
nk_str = input()
string = input()
nk_list = nk_str.split()
k = int(nk_list[-1])
string_list = [c for c in string]
string_list[k - 1] = string_list[k - 1].lower()
string = ''.join(string_list)
print(string)
Buggy python submission (verdict: Runtime Error):
str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
print(num_lis[K])

Fixed submission:
str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
lis = num_lis[::-1]
print(lis[K - 1])

Buggy python submission (verdict: Runtime Error):
str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
print(num_lis[K]

Fixed submission:
str_lis = input().split()
A, B, K = [int(x) for x in str_lis]
N = min(A, B)
num_lis = [n for n in range(1, N + 1) if A % n == 0 and B % n == 0]
lis = num_lis[::-1]
print(lis[K - 1])
Buggy python submission (verdict: Runtime Error):
nandm = input().split()
numlist = input().split()
N = int(nandm[0])
M = int(nandm[1])
if N >= M:
    print(0)
else:
    intlist = [int(num) for num in numlist]
    intlist.sort()
    subtract = [intlist[i + 1] - intlist[i] for i in range(len(intlist) - 1)]
    subtract.sort()
    print(sum(subtract[:(M - N)]))

Fixed submission:
lis = input().split()
print(int(lis[0])/int(lis[1]))
Buggy python submission (verdict: Runtime Error):
nandm = input().split()
numlist = input().split()
N = int(nandm[0])
M = int(nandm[1])
if N >= M:
    print(0)
else:
    intlist = [int(num) for num in numlist]
    intlist.sort()
    subtract = [intlist[i + 1] - intlist[i] for i in range(len(intlist) - 1)]
    subtract.sort()
    print(sum(subtract[M - N]))

Fixed submission:
nandm = input().split()
numlist = input().split()
N = int(nandm[0])
M = int(nandm[1])
if N >= M:
    print(0)
else:
    intlist = [int(num) for num in numlist]
    intlist.sort()
    subtract = [intlist[i + 1] - intlist[i] for i in range(len(intlist) - 1)]
    subtract.sort()
    print(sum(subtract[:(M - N)]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
char_list = input().split()
num_list = list(map(int, char_list))

def is_even(lis):
    return [x for x in lis if x % 2]

mod2_list = is_even(num_list)

i = 0
while mod2_list == []:
    num_list = [x / 2 for x in num_list]
    mod2_list = is_even(num_list)
    i += 1
    
print(i)

Fixed submission:
char_list = list(input())
num_list = list(map(int, char_list))
out = sum(num_list)
print(out)
Buggy python submission (verdict: Runtime Error):
S = str(input())
F = int(S[0:2])
T = int(S[2:4])

def Greaterthan12(x):
    if x > 12:
        return 0
    else:
        return 1
        
Fjudge = BorS(F)
Tjudge = BorS(T)
if Fjudge == 0:
    if Tjudge == 0:
        print("NA")
    else:
        print("YYMM")
else:
    if Tjudge == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")

Fixed submission:
S = str(input())
F = int(S[0:2])
T = int(S[2:4])

def Greaterthan12(x):
    if x > 12:
        return 0
    else:
        if x == 0:
            return 0
        else:
            return 1
        
Fjudge = Greaterthan12(F)
Tjudge = Greaterthan12(T)
if Fjudge == 0:
    if Tjudge == 0:
        print("NA")
    else:
        print("YYMM")
else:
    if Tjudge == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")