Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

def lcm(x,y):
    return x*y//gcd(x,y)
mod = 10**9+7
n = int(input())
a = list(map(int,input().split()))
L = a[0]
for i in a:
    L = lcm(L,i)
    
ans = 0
for i in a:
    ans += (L // i )
print(ans % mod)

Fixed submission:
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

def lcm(x,y):
    return x*y//gcd(x,y)

mod = 10**9+7
n = int(input())
a = list(map(int,input().split()))
L = a[0]
for i in a:
    L = lcm(L,i)
    
ans = 0
for i in a:
    ans += (L // i )
print(ans % mod)
Buggy python submission (verdict: Runtime Error):
import math 
def lcm(x,y):
    return x*y//math.gcd(x,y)
n,m = map(int,input().split())
a = list(map(int,input().split()))
gcds = a[0]
for i in a:
    gcds = lcm(gcds,i)
a = [i//2 for i in a]
a_0 = a[0]
for i in a:
    a_0 = lcm(a_0,i)
#print(a_0,gcds)
if a_0 < m:
    ans = math.ceil((m - a_0) // gcds)
elif a_0 == m:
    ans = 1
else:
    ans = 0
print(ans)

Fixed submission:
k,x = map(int,input().split())
if k*500 >= x:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
if (b-a-1) % 2 == 0:
    #print(b-1,n-a)
    ans = min(a-1, n-b) + 1  + (B-A-1)//2
else:
    ans = (b-a)//2
print(ans)

Fixed submission:
n,a,b = map(int,input().split())
if (b-a-1) % 2 == 0:
    ans = min(a-1, n-b) + 1 + (b-a-1)//2
else:
    ans = (b-a)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
a,b = map(int,input().split())
print(np.lcm(a, b))

Fixed submission:
import fractions
a,b = map(int,input().split())
print(int(a * b / fractions.gcd(a, b)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
left = 0
num = 1
while True:
    Flag = True
    for i in range(len(a)):
        if a[i] == num:
            left += 1
            a = a[i:]
            Flag = False
            num += 1
            break
    if Flag:
        break
if left == 0:
    ans = -1
else:
    ans = n - left
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
left = 0
num = 1
start = 0
while True:
    Flag = True
    for i in range(start,n):
        if a[i] == num:
            left += 1
            start = i
            Flag = False
            num += 1
            break
    if Flag:
        break
if left == 0:
    ans = -1
else:
    ans = n - left
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
Ans = []
for i in range(n):
    Ai = int(input())
    a = []
    for j in range(Ai):
        x,y = map(int,input().split())
        a.append((x,y))
    Ans.append(a)
Honest = 0
TT = [bin(i)[2:].zfill(n) for i in range(2**n)]
#print(TT)
for truth in TT:
    truth = str(truth)
    people = [-1]*n
    #print("====")
    #print(truth)
    flag = True
    for i in range(n):
        tt = truth[i]
        answers = Ans[i]
        #print(answers)
        if tt == "1":
            #証言は信頼できると仮定
            for x,v in answers:
                #xに対してv
                if v:#x人が正直者という証言
                    if people[x-1] == 0:#xは嘘つきと証言されているとき
                        flag = False
                        #print("A")
                    else:
                        people[x-1] = 1
                else:#xは嘘つきという証言
                    if people[x-1] == 1:
                        flag = False
                        #print("B")
                    else:
                        people[x-1] = 0
        else:
            #証言は嘘と仮定
            for x,v in answers:
                if v == 0:
                    if people[x-1] == 0:#xは嘘つきと証言されているとき
                        flag = False
                        #print("C")
                    else:
                        people[x-1] = 1
                else:#xは嘘つきという証言
                    if people[x-1] == 1:
                        flag = False
                        #print("D")
                    else:
                        people[x-1] = 0
    if flag:
        Flag = True
        for i in range(len(people)):
            if people[i] == -1:
                people[i] = 0
            else:
                if truth[i] != str(people[i]):
                    Flag = False
                    break
        #print(*people)
        
        if Flag:
            Honest = max(Honest,sum(people))
print(Honest)


Fixed submission:
n,m,l = map(int,input().split())
if n+m+l <= 21:
    print("win")
else:
    print("bust")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
mod = 10e9+7
ans = 0
for i in range(60):
    x = 1 << i
    n = len([1 for j in a if j & X])
    ans += x * n * (N-n) % mod
    ans %= mod
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
ans = 0
for i in range(60):
    x = 1<< i
    l = len([1 for j in a if j & x])
    ans += x * l * (n-l) % mod
    ans %= mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = input()
ans = set()
for x in itertools.combinations(s,3):
    ans.add(x)
print(len(ans))

Fixed submission:
int(input())
s = list(input())
ans = 0
for i in range(10):
    if str(i) in s:
        ss = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in ss:
                sss = ss[ss.index(str(j))+1:]
                for k in range(10):
                    if str(k) in sss:
                        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = input()
ans = set()
for x in itertools.combinations(s,3):
    ans.add(x)
print(len(ans))

Fixed submission:
int(input())
s = list(input())
ans = 0
for i in range(10):
    if str(i) in s:
        ss = s[s.index(str(i))+1:]
        for j in range(10):
            if str(j) in ss:
                sss = ss[ss.index(str(j))+1:]
                for k in range(10):
                    if str(k) in sss:
                        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
X,Y = map(int,input().split())
if (X + Y) % 3 != 0:
    print(0)
    exit()
n = (-X+2*Y)//3
m = (2*X-Y)//3
if n < 0 or m < 0:
    print(0)
    exit()

mod = 10**9+7
mod_inv = [0, 1] + [0] * (min(n,m)+3)
for i in range(2, min(n,m)+5):
    mod_inv[i] = - mod_inv[mod % i] * (mod // i) % mod
def comod(n, r, mod):
    ans = 1
    for i in range(r):
        ans *= (n-i) % mod
        ans *= mod_inv[i+1]
        ans %= mod
    return ans
ans = comod(n+m,n,mod)
print(ans)

Fixed submission:
X,Y = map(int,input().split())
if (X + Y) % 3 != 0:
    print(0)
    exit()
n = (-X+2*Y)//3
m = (2*X-Y)//3
if n < 0 or m < 0:
    print(0)
    exit()

mod = 10**9+7
mod_inv = [0, 1] + [0] * (max(n,m)+3)
for i in range(2, max(n,m)+5):
    mod_inv[i] = - mod_inv[mod % i] * (mod // i) % mod
def comod(n, r, mod):
    ans = 1
    for i in range(r):
        ans *= (n-i) % mod
        ans *= mod_inv[i+1]
        ans %= mod
    return ans
ans = comod(n+m,n,mod)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
ans = 0
for i in range(len(s)+1):
    left = s[0:i]
    right = s[i:]
    l = 0
    r = 0
    for i in range(len(left)-1,-1,-1):
        if left[i] != "<":
            break
        else:
            l += 1
    for i in range(len(right)):
        if right[i] != ">":
            break
        else:
            r += 1
    ans += max(l,r)
print(ans)


Fixed submission:
from itertools import *
s = input()
g = [[k,len(list(v))] for k,v in groupby(s)]
ans = 0
for command,length in g:
    ans += length*(length+1)//2
for i in range(len(g)-1):
    if g[i][0] == "<":
        ans -= min(g[i][1],g[i+1][1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
ans = 0
for i in range(len(s)+1):
    left = s[0:i]
    right = s[i:]
    l = 0
    r = 0
    for i in range(len(left)-1,-1,-1):
        if left[i] != "<":
            break
        else:
            l += 1
    for i in range(len(right)):
        if right[i] != ">":
            break
        else:
            r += 1
    ans += max(l,r)
print(ans)

Fixed submission:
from itertools import *
s = input()
g = [[k,len(list(v))] for k,v in groupby(s)]
ans = 0
for command,length in g:
    ans += length*(length+1)//2
for i in range(len(g)-1):
    if g[i][0] == "<":
        ans -= min(g[i][1],g[i+1][1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
j = []
k = []
for i in range(len(s)+1):
    left = s[0:i]
    right = s[i:]
    l = 0
    r = 0
    for i in range(len(left)-1,-1,-1):
        if left[i] != "<":
            break
        else:
            l += 1
    for i in range(len(right)):
        if right[i] != ">":
            break
        else:
            r += 1
    j.append(max(l,r))
print(sum(j))

Fixed submission:
from itertools import *
s = input()
g = [[k,len(list(v))] for k,v in groupby(s)]
ans = 0
for command,length in g:
    ans += length*(length+1)//2
for i in range(len(g)-1):
    if g[i][0] == "<":
        ans -= min(g[i][1],g[i+1][1])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
#a = [ int(input()) for i in range(q)]
h = [k]*n

for i in range(q):
    a = int(input())
    h = [ h[i] - 1 for i in range(n)]
    h[a-1] += 1

for i in range(n):
    if h[i] > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n,k,q = map(int,input().split())
h = [k]*n

for i in range(q):
    a = int(input())
    h[a-1] += 1
h = [ h[i] - q for i in range(n)]

for i in range(n):
    if h[i] > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
numl = [i for i in range(2,a+1)] + [1]
ans = 0
for i in range(a):
    ans += (i+1) % numl[i]
print(ans)

Fixed submission:
a = int(input())
print(a*(a-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
modl = [i for i in range(1,a+1)]
numl = [i for i in range(2,a+1)] + [1]
ans = 0
for i in range(a):
    ans += modl[i] % numl[i]
print(ans)

Fixed submission:
a = int(input())
print(a*(a-1)//2)
Buggy python submission (verdict: Runtime Error):
m,d = map(int,input().split())
ans = 0
if d < 10:
    print(ans)
else:
    for month in range(1,m+1):
        for day in range(1,d+1):
            if int(str(day)[0])*int(str(day)[1]) == month:
                if int(str(day)[1]) >= 2 and int(str(day)[0]) >= 2:
                    ans += 1
    print(ans)

Fixed submission:
m,d = map(int,input().split())
ans = 0
if d < 10:
    print(ans)
else:
    for month in range(1,m+1):
        for day in range(10,d+1):
            if int(str(day)[0])*int(str(day)[1]) == month:
                if int(str(day)[1]) >= 2 and int(str(day)[0]) >= 2:
                    ans += 1
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.reverse()
ans = 0
for i in range(n):
    tmp = 0
    Tmp = 0
    tmplist = [a[i]]
    index = i
    for _ in range(n-1):
        index += 1
        index %= n
        tmplist.append(a[index])
    for j in range(1,n):
        if tmplist[j] > a[i]:
            tmp += 1
    for j in range(i,n):
        if a[j] > a[i]:
            Tmp += 1
    ans += Tmp*k + tmp * (k-1)*k//2
    #print(tmplist,Tmp,tmp)
ans = ans % (10**9 + 7 )
print(ans)

Fixed submission:
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.reverse()
ans = 0
for i in range(n):
    tmp = 0
    Tmp = 0
    tmplist = [a[i]]
    index = i
    for _ in range(n-1):
        index += 1
        index %= n
        tmplist.append(a[index])
    for j in range(1,n):
        if tmplist[j] > a[i]:
            tmp += 1
    for j in range(i,n):
        if a[j] > a[i]:
            Tmp += 1
    ans += Tmp*k + tmp * (k-1)*k//2
    #print(tmplist,Tmp,tmp)
ans = ans % (10**9 + 7 )
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline


def dfs(v, par):
    for nv in tree[v]:
        if nv != par:
            adds[nv] += adds[v]
            dfs(nv, v)


n,q = map(int, input().split())
tree = [[]for _ in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

adds = [0] * n
for i in range(q):
    p,x = map(int, input().split())
    p -= 1
    adds[p] += x
dfs(0, -1)
print(*adds)


Fixed submission:
import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline


def dfs(v, par):
    for nv in tree[v]:
        if nv != par:
            adds[nv] += adds[v]
            dfs(nv, v)


n,q = map(int, input().split())
tree = [[]for _ in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

adds = [0] * n
for i in range(q):
    p,x = map(int, input().split())
    p -= 1
    adds[p] += x
dfs(0, -1)
print(*adds)

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


def dfs(v, par):
    for nv in tree[v]:
        if nv != par:
            adds[nv] += adds[v]
            dfs(nv, v)


n,q = map(int, input().split())
tree = [[]for _ in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

adds = [0] * n
for i in range(q):
    p,x = map(int, input().split())
    p -= 1
    adds[p] += x
dfs(0, -1)
print(*adds)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline


def dfs(v, par):
    for nv in tree[v]:
        if nv != par:
            adds[nv] += adds[v]
            dfs(nv, v)


n,q = map(int, input().split())
tree = [[]for _ in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

adds = [0] * n
for i in range(q):
    p,x = map(int, input().split())
    p -= 1
    adds[p] += x
dfs(0, -1)
print(*adds)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
tmp = []
for i in range(n):
    s = list(str(input()))
    s.sort()
    tmpstr = "".join(s)
    tmp.append(tmpstr)
T = set(tmp)
ans = 0
for i in T:
    ans += (tmp.count(i) - 1 )*(tmp.count(i))//2
print(ans)

Fixed submission:
import collections
n = int(input())
tmp = []
for i in range(n):
    s = list(str(input()))
    s.sort()
    tmpstr = "".join(s)
    tmp.append(tmpstr)
ans = 0
c = collections.Counter(tmp)
for i in c.keys():
    if c[i] >= 2:
        ans += (c[i]  - 1 )*(c[i] )//2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
num = [ int(input()) for _ in range(n) ]
B = sorted(num,revese=True)
maxnum = B[0]
maxnum2 = B[1]

for i in range(n):
    if num[i] != maxnum:
        print(maxnum)
    else:
        print(maxnum2)

Fixed submission:
n = int(input())
num = [ int(input()) for _ in range(n) ]
B = sorted(num,reverse=True)
maxnum = B[0]
maxnum2 = B[1]

for i in range(n):
    if num[i] != maxnum:
        print(maxnum)
    else:
        print(maxnum2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num = [ int(input()) for _ in range(n) ]
maxnum = max(num)
for i in range(n):
    if num[i] != maxnum:
        print(maxnum)
    else:
        print(max(num[0:i]+num[i+1:]))

Fixed submission:
n = int(input())
num = [ int(input()) for _ in range(n) ]
B = sorted(num,reverse=True)
maxnum = B[0]
maxnum2 = B[1]

for i in range(n):
    if num[i] != maxnum:
        print(maxnum)
    else:
        print(maxnum2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num = [ int(input()) for _ in range(n) ]
for i in range(n):
    print(max(num[0:i]+num[i+1:]))

Fixed submission:
n = int(input())
num = [ int(input()) for _ in range(n) ]
B = sorted(num,reverse=True)
maxnum = B[0]
maxnum2 = B[1]

for i in range(n):
    if num[i] != maxnum:
        print(maxnum)
    else:
        print(maxnum2)
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
print(min(n*a),b)

Fixed submission:
n,a,b = map(int,input().split())
print(min(n*a,b))
Buggy python submission (verdict: Runtime Error):
n,d = map(int,input().split())
obj = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    for j in range(n):
        if i == j:
            pass
        else:
            dis = 0
            for k in range(d):
                dis += (obj[i][k] - obj[j][k])**2
            dis = dis ** 0.5
            if dis == dis // 1:
                ans += 1

print(ans//2

Fixed submission:
n,d = map(int,input().split())
obj = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    for j in range(n):
        if i == j:
            pass
        else:
            dis = 0
            for k in range(d):
                dis += (obj[i][k] - obj[j][k])**2
            dis = dis ** 0.5
            if dis == dis // 1:
                ans += 1

print(ans//2)
Buggy python submission (verdict: Runtime Error):
s = str(input())
j = list(set(list(s)))
c1 = j[0]
c2 = j[1]
if len(j) == 2 and s.count(c1) == 2 and s.count(c2) == 2:
    print("Yes")
else:
    print("No")

Fixed submission:
s = str(input())
j = list(set(list(s)))
c1 = j[0]
try:
    c2 = j[1]
except:
    print("No")
    exit()
if len(j) == 2 and s.count(c1) == 2 and s.count(c2) == 2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from math import factorial
def C(n,k):
    return factorial(n)//(factorial(k)*(factorial(n-k)))
mod = 10e9+7
n,k = map(int,input().split())
for i in range(1,k+1):
    print(C(n-k+1,i) * C(k-1,i-1) % (10**9+7))

Fixed submission:
n,k = map(int,input().split())
mod = 10**9+7
a = 1
b = n-k+1
for i in range(k):
    ans = a*b % mod
    print(ans)
    a = a * (k-1-i)//(i+1)
    b = b * (n-k-i)//(i+2)

Buggy python submission (verdict: Runtime Error):
from math import factorial
def C(n,k):
    return factorial(n)//(factorial(k)*factorial(n-k))

n,k = map(int,input().split())
for i in range(1,k+1):
    print(C(n-k+1,i) * C(k-1,i-1))

Fixed submission:
n,k = map(int,input().split())
mod = 10**9+7
a = 1
b = n-k+1
for i in range(k):
    ans = a*b % mod
    print(ans)
    a = a * (k-1-i)//(i+1)
    b = b * (n-k-i)//(i+2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
tasks = []

for _ in range(n):
    c,d = map(int,input().split())
    tasks.append([d,c])
tasks.sort()
maxday = tasks[-1][0]
cul = [0] * maxday
for i in range(n):
    day = tasks[i][0]
    cost = tasks[i][1]
    if day - sum(cul[0:day+1]) < cost :
        print("No")
        exit()
    else:
        j = 0
        k = 0
        while k < cost:
            if cul[j] == 0:
                cul[j] = 1
                k += 1

            j += 1
    #print(cul)
print("Yes")

Fixed submission:
n = int(input())
tasks = []

for _ in range(n):
    c,d = map(int,input().split())
    tasks.append([d,c])
tasks.sort()
maxday = tasks[-1][0]
worked = 0
for i in range(n):
    day = tasks[i][0]
    cost = tasks[i][1]
    if day - worked < cost :
        print("No")
        exit()
    else:
        worked += cost
print("Yes")
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import bisect
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
#Query = []
#for _ in range(m):
#    b,c = map(int,input().split())
#    Query.append([c,b])
#Query.sort(reverse=True)
Query = [list(map(int,input().split())) for _ in range(m)]
Query = sorted(Query, key=lambda x:(x[1], x[0]), reverse=True)
ans = 0
for b,c in Query:
    #b,c = Query[i][1],Query[i][0]
    #b,c = Query[i][0],Query[i][1]
    if A[0] >= c:
        break
    else:
        #A.sort()
        index = bisect.bisect_left(A,c)
        ans += sum(A[index:])
        if b <= index:
            #for i in range(b):
            #    A[i] = c
            A = A[b:index].extend([c for i in range(b)])
        else:
            #for i in range(index):
            #    A[i] = c
            A = [ c for i in range(index)]
    #print(A)
print(ans + sum(A))

Fixed submission:
a,b = map(int,input().split())
if a >= 13:
    ans = b
elif 6 <= a <= 12:
    ans = b//2
else:
    ans = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import bisect
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
Query = [list(map(int,input().split())) for _ in range(m)]
Query = sorted(Query, key=lambda x:(x[1], x[0]), reverse=True)
for b,c in Query:
    if A[0] >= c:
        break
    else:
        index = bisect.bisect_left(A,c)
        if b <= index:
            A = A[b:index] + [c for i in range(b)] + A[index:]
        else:
            A = [ c for i in range(index)] + A[index:]
print(sum(A))

Fixed submission:
a,b = map(int,input().split())
if a >= 13:
    ans = b
elif 6 <= a <= 12:
    ans = b//2
else:
    ans = 0
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import bisect
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
Query = []
for _ in range(m):
    b,c = map(int,input().split())
    Query.append([c,b])
Query.sort(reverse=True)
for i in range(m):
    b,c = Query[i][1],Query[i][0]
    if A[0] >= c:
        break
    else:
        #A.sort()
        index = bisect.bisect_left(A,c)
        if b <= index:
            #for i in range(b):
            #    A[i] = c
            A = A[b:index] + [c for i in range(b)] + A[index:]
        else:
            #for i in range(index):
            #    A[i] = c
            A = [ c for i in range(index)] + A[index:]
    #print(A)
print(sum(A))

Fixed submission:
a,b = map(int,input().split())
if a >= 13:
    ans = b
elif 6 <= a <= 12:
    ans = b//2
else:
    ans = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
s = list(str(input()))
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if 0 < a < 13:
    if 0 < b < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if 0 < b < 13:
        print("YYMM")
    else:
        print("NA")
print(ans)


Fixed submission:
s = list(str(input()))
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if 0 < a < 13:
    if 0 < b < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if 0 < b < 13:
        print("YYMM")
    else:
        print("NA")

Buggy python submission (verdict: Runtime Error):
s = list(str(input()))
A = int(s[0]+s[1])
B = int(s[2]+s[3])
if 0 < a < 13:
    if 0 < b < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if 0 < b < 13:
        print("YYMM")
    else:
        print("NA")
print(ans)


Fixed submission:
s = list(str(input()))
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if 0 < a < 13:
    if 0 < b < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if 0 < b < 13:
        print("YYMM")
    else:
        print("NA")
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0
ls = 0
rs = 0
lr = 0
for _ in range(N):
    s = str(input())
    if "AB" in s:
        ans += 1
    if s[-1] == "A" and s[0] == "B":
        lr += 1
    elif s[-1] == "A":
        rs += 1
    elif s[0] == "B":
        ls += 1
if ls == 0 and rs == 0:
    ans += lr - 1 
elif ls == 0 and rs != 0:
    ans += lr
elif ls != 0 and rs == 0:
    ans += lr
else:
    lr += 1
    rs -= 1
    ls -= 1
    ans += lr
    ans += (rs+ls)//2
#ans += lr
print(ans)

Fixed submission:
a,b = map(int,input().split())

ans = 0
for i in range(a):
    if i + b > a:
        break
    else:
        ans += 1
print(ans)