Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b,c,d,e=[int(input()) for _ in range(6)]
cnt=[n,0,0,0,0,0]
t=0
while cnt[5]!=n:
    c0,c1,c2,c3,c4,c5=cnt[0],cnt[1],cnt[2],cnt[3],cnt[4],cnt[5]
    cnt[0]-=min(a,c0)
    cnt[1]+=min(a,c0)-min(b,c1)
    cnt[2]+=min(b,c1)-min(c,c2)
    cnt[3]+=min(c,c2)-min(d,c3)
    cnt[4]+=min(d,c3)-min(e,c4)
    cnt[5]+=min(e,c4)
    t+=1
print(t)

Fixed submission:
import math
a=[int(input()) for _ in range(6)]
flag=a.index(min(a))
ans=4+math.ceil(a[0]/min(a))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
def main():
    n,p=map(int,input().split())
    if n==1:
        print(p)
    else:
        q=math.ceil(p**(1/n))
        ans=1
        for i in range(q,0,-1):
            if p%(i**n)==0:
                ans=i
                break
        print(ans)
if __name__=="__main__":
    main()

Fixed submission:
import math
def main():
    n,p=map(int,input().split())
    if n==1:
        print(p)
    elif n>39:
        print(1)
    else:
        q=math.ceil(p**(1/n))
        ans=1
        for i in range(q,0,-1):
            if p%(i**n)==0:
                ans=i
                break
        print(ans)
if __name__=="__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
s=list(input())
ans=0
for i in range(len(s)-1):
    if s[i]=="B":
        ans+=s[i+1:].count("W")
        if s[i+1:].count("W")==0:
            break
print(ans)

Fixed submission:
s=list(input())
n=len(s)
ans=0
res=0
for i in range(n):
    if s[n-1-i]=="W":
        res+=1
    else:
        ans+=res
print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions
def main():
    n,m=map(int,input().split())
    s=input()
    t=input()
    ans=-1
    gcd0=fractions.gcd(n,m)
    lcm=n*m//gcd0
    flg=1
    for i in range(gcd0):
        if s[n*i//gcd0]!=t[m*i//gcd0]:
            flg=0
            break
    if flg==1:
        ans=lcm
	print(ans)
if __name__=="__main__":
    main()

Fixed submission:
import fractions
def main():
    n,m=map(int,input().split())
    s=input()
    t=input()
    ans=-1
    gcd0=fractions.gcd(n,m)
    lcm=n*m//gcd0
    flg=1
    for i in range(gcd0):
        if s[n*i//gcd0]!=t[m*i//gcd0]:
            flg=0
            break
    if flg==1:
        ans=lcm
    print(ans)
if __name__=="__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import fractions
def main():
    n,m=map(int,input().split())
    s=input()
    t=input()
    ans=-1
    gcd0=fractions.gcd(n,m)
    lcm=n*m//gcd0
    flg=1
    for i in range(gcd0):
        if s[n*i//gcd0]!=t[m*i//gcd0]:
            flg=0
            break
    if flg==1:
        ans=lcm
print(ans)
if __name__=="__main__":
    main()

Fixed submission:
import fractions
def main():
    n,m=map(int,input().split())
    s=input()
    t=input()
    ans=-1
    gcd0=fractions.gcd(n,m)
    lcm=n*m//gcd0
    flg=1
    for i in range(gcd0):
        if s[n*i//gcd0]!=t[m*i//gcd0]:
            flg=0
            break
    if flg==1:
        ans=lcm
    print(ans)
if __name__=="__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n=input()
if n[0]>n[1] or (n[0]=n[1] and n[1]>=n[2]):
    print(int(n[0])*111)
else:
    print(int(n[0])*111+111)

Fixed submission:
n=input()
if n[0]>n[1] or (n[0]==n[1] and n[1]>=n[2]):
    print(int(n[0])*111)
else:
    print(int(n[0])*111+111)

Buggy python submission (verdict: Runtime Error):
n=input()
if n[0]>n[1] or (n[0]=n[1] and n[1]>=n[2]):
    print(int(n[0])*111
else:
    print(int(n[0])*111+111)

Fixed submission:
n=input()
if n[0]>n[1] or (n[0]==n[1] and n[1]>=n[2]):
    print(int(n[0])*111)
else:
    print(int(n[0])*111+111)
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
u=[]
v=[]
s_len=len(s)
for i in range(s_len):
    s_i=s[i]
    t_i=t[i]
    ts=t_i+s_i
    if s_i!=t_i:
        if ts not in u:
            u.append(ts)
    elif s_i not in v:
        v.append(s_i)
u_len=len(u)
ans="Yes"
if u_len!=0:
    u.sort()
    u.append("XX")
    u_len=len(u)
    for i in range(u_len):
        if u[i][0] in v or u[i][1] in v:
            ans="No"
            break
        elif u[i][0]==u[i+1][0] and u[i][1]!=u[i+1][1]:
            ans="No"
            break       
print(ans)

Fixed submission:
from operator import itemgetter
s=input()
t=input()
u=[]
v=[]
s_len=len(s)
for i in range(s_len):
    s_i=s[i]
    t_i=t[i]
    ts=t_i+s_i
    if s_i!=t_i:
        if ts not in u:
            u.append(ts)
    elif s_i not in v:
        v.append(s_i)
u_len=len(u)
ans="Yes"
if u_len!=0:
    u1=sorted(u)
    u1.append("XX")
    for i in range(u_len):
        if u1[i][0] in v or u1[i][1] in v:
            ans="No"
            break
        elif u1[i][0]==u1[i+1][0] and u1[i][1]!=u1[i+1][1]:
            ans="No"
            break
    if ans=="Yes":
        u2=sorted(u,key=itemgetter(1))
        u2.append("XX")
        for i in range(u_len):
            if u2[i][0]!=u2[i+1][0] and u2[i][1]==u2[i+1][1]:
                ans="No"
                break
print(ans)

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
u=[]
v=[]
s_len=len(s)
for i in range(s_len):
    s_i=s[i]
    t_i=t[i]
    ts=t_i+s_i
    if s_i!=t_i:
        if ts not in u:
            u.append(ts)
    elif s_i not in v:
        v.append(s_i)
u.sort()
u.append("XX")
ans="Yes"
u_len=len(u)
for i in range(u_len):
    if u[i][0] in v or u[i][1] in v:
        ans="No"
        break
    elif u[i][0]==u[i+1][0] and u[i][1]!=u[i+1][1]:
        ans="No"
        break       
print(ans)

Fixed submission:
from operator import itemgetter
s=input()
t=input()
u=[]
v=[]
s_len=len(s)
for i in range(s_len):
    s_i=s[i]
    t_i=t[i]
    ts=t_i+s_i
    if s_i!=t_i:
        if ts not in u:
            u.append(ts)
    elif s_i not in v:
        v.append(s_i)
u_len=len(u)
ans="Yes"
if u_len!=0:
    u1=sorted(u)
    u1.append("XX")
    for i in range(u_len):
        if u1[i][0] in v or u1[i][1] in v:
            ans="No"
            break
        elif u1[i][0]==u1[i+1][0] and u1[i][1]!=u1[i+1][1]:
            ans="No"
            break
    if ans=="Yes":
        u2=sorted(u,key=itemgetter(1))
        u2.append("XX")
        for i in range(u_len):
            if u2[i][0]!=u2[i+1][0] and u2[i][1]==u2[i+1][1]:
                ans="No"
                break
print(ans)
Buggy python submission (verdict: Runtime Error):
3
abc
arc
agc

Fixed submission:
n=int(input())
w_before=input()
word=[w_before]
ans="Yes"
for i in range(1,n):
    w=input()
    if  w[0]!=w_before[-1] or w in word:
        ans="No"
        break
    else:
        w_before=w
        word.append(w)
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
if a in s and b in s and c in s:
    print("Yes")
else:
    print("No")

Fixed submission:
s=input()
if "a" in s and "b" in s and "c" in s:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x,a,b=[int(input) for i in range(3)]
ans=(x-a)%b
print(ans)

Fixed submission:
x,a,b=[int(input()) for i in range(3)]
ans=(x-a)%b
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
if s=="AKIHABARA":
    print("YES")
else:
    ans="YES"
    if len(s)>9 or (len(s)==9 and s!="AKIHABARA") or "KIH" not in s:
        ans="NO"
    else:
        s.remove("A")
        if s!="KIHBR":
            ans="NO"
        else:
            k,b,r=s.find("K"),s.find("B"),s.find("R")
            if k>1 or b-k>4 or r-b>2:
                ans="NO"
    print(ans)

Fixed submission:
s=input()
if s=="AKIHABARA":
    print("YES")
else:
    ans="YES"
    if len(s)>=9 or "KIH" not in s:
        ans="NO"
    else:
        t=s.replace("A","")
        if t!="KIHBR":
            ans="NO"
        else:
            k,b,r=s.find("K"),s.find("B"),s.find("R")
            if k>1 or b-k>4 or r-b>2:
                ans="NO"
    print(ans)
Buggy python submission (verdict: Runtime Error):
c1=input()
c2=input()
c2.reverse()
if c1==c2:
    print("YES")
else:
    print("No")

Fixed submission:
c1=input()
c2=input()
c2_rev=c2[::-1]
if c1==c2_rev:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s=input()
s_len=len(s)
print([:s_len-8])

Fixed submission:
s=input()
s_len=len(s)
print(s[:s_len-8])
Buggy python submission (verdict: Runtime Error):
s=input()
ans=0
for i in range(n):
    if s[i]=="1":
        ans+=1
print(ans)

Fixed submission:
s=input()
ans=0
for i in range(6):
    if s[i]=="1":
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[-1,0]
i=0
while i<n-1:
    res=0
    while a[i+res]-a[i]<=2:
        res+=1
    if res>ans[1]:
        ans[1]=res
        ans[0]=i
    i+=res
print(ans[1])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[-1,0]
i=0
while i<=n-1:
    res=0
    cnt=0
    while i+res<=n-1 and a[i+res]-a[i]<=2:
        if a[i+res]==a[i]:
            cnt+=1
        res+=1
    if res>ans[1]:
        ans[1]=res
        ans[0]=i
    i+=cnt
print(ans[1])
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
a_x=abs(a,x)
b_x=abs(b,x)
if a_x<b_x:
    print("A")
else:
    print("B")

Fixed submission:
x,a,b=map(int,input().split())
a_x=abs(a-x)
b_x=abs(b-x)
if a_x<b_x:
    print("A")
else:
    print("B")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
while ans<=n:
    ans*2
print(ans//2)

Fixed submission:
n=int(input())
ans=1
while ans<=n:
    ans*=2
print(ans//2)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
while(ans<=n):
    ans*2
print(ans//2)

Fixed submission:
n=int(input())
ans=1
while ans<=n:
    ans*=2
print(ans//2)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
first=[]
second=[]
for i in range(m):
    ai,bi=map(int,input().split())
    if ai==1:
        first.append(bi)
    elif bi==n:
        second.append(ai)
    fset,sset=set(first),set(second)
if len(list(fset&sset))>=1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Fixed submission:
n,m=map(int,input().split())
check=[0]*n
ans="IMPOSSIBLE"
for i in range(m):
    ai,bi=map(int,input().split())
    if ai==1:
        if check[bi-1]==1:
            ans="POSSIBLE"
            break
        else:
            check[bi-1]+=1
    elif bi==n:
        if check[ai-1]==1:
            ans="POSSIBLE"
            break
        else:
            check[ai-1]+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
first=[]
second=[]
ans="IMPOSSIBLE"
for i in range(m):
    ai,bi=map(int,input().split())
    if ai==1:
        if bi in second:
            ans="POSSIBLE"
            break
        else:
            first.append(bi)
    elif bi==n:
        if ai in first:
            ans="POSSIBLE"
            break
        else:
            second.append(ai)
print(ans)

Fixed submission:
n,m=map(int,input().split())
check=[0]*n
ans="IMPOSSIBLE"
for i in range(m):
    ai,bi=map(int,input().split())
    if ai==1:
        if check[bi-1]==1:
            ans="POSSIBLE"
            break
        else:
            check[bi-1]+=1
    elif bi==n:
        if check[ai-1]==1:
            ans="POSSIBLE"
            break
        else:
            check[ai-1]+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
first=[]
second=[]
for i in range(m):
    ai,bi=map(int,input().split())
    if ai==1:
        first.append(bi)
    elif bi==n:
        second.append(ai)
ans="IMPOSSIBLE"
if len(first)!=0 and len(second)!=0:
    for i in first:
        if i in second:
            ans="POSSIBLE"
            break
print(ans)

Fixed submission:
n,m=map(int,input().split())
check=[0]*n
ans="IMPOSSIBLE"
for i in range(m):
    ai,bi=map(int,input().split())
    if ai==1:
        if check[bi-1]==1:
            ans="POSSIBLE"
            break
        else:
            check[bi-1]+=1
    elif bi==n:
        if check[ai-1]==1:
            ans="POSSIBLE"
            break
        else:
            check[ai-1]+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for _ in range(n)]
b=[1]
buf=1
if 2 not in a:
    print(-1)
else:
    while True:
        a_buf=a[buf-1]
        if a_buf==2:
            print(len(b))
            break
        elif a_buf in b:
            print(-1)
            break
        b.append(a_buf)
        buf=a_buf

Fixed submission:
n=int(input())
a=[int(input()) for _ in range(n)]
b=[1]
buf=1
count=0
if 2 not in a:
    print(-1)
else:
    while count<n:
        a_buf=a[buf-1]
        #print("buf,a[buf-1],b=",buf,a[buf-1],b)
        if a_buf==2:
            #print("check_2")
            print(len(b))
            break
        #elif a_buf in b:
            #print("check_loop")
            #print(-1)
            #break
        b.append(a_buf)
        buf=a_buf
        count+=1
    if count==n:
        print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for _ in range(n)]
b=[1]
buf=1
if 2 not in a:
    print(-1)
else:
    while True:
        if a[buf-1]==2:
            print(len(b))
            break
        elif a[buf-1] in b:
            print(-1)
            break
        b.append(a[buf-1])
        buf=a[buf-1]

Fixed submission:
n=int(input())
a=[int(input()) for _ in range(n)]
b=[1]
buf=1
count=0
if 2 not in a:
    print(-1)
else:
    while count<n:
        a_buf=a[buf-1]
        #print("buf,a[buf-1],b=",buf,a[buf-1],b)
        if a_buf==2:
            #print("check_2")
            print(len(b))
            break
        #elif a_buf in b:
            #print("check_loop")
            #print(-1)
            #break
        b.append(a_buf)
        buf=a_buf
        count+=1
    if count==n:
        print(-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
check=[0]*8
while i<n and a[i]<3200:
    a_i=a[i]
    for j in range(8):
        if check[j]==0 and a_i>=400*j and a_i<400*(j+1):
            check[j]=1
            break
    i+=1
if sum(check)==0:
    ans_min=1
    ans_max_=n
else:
    ans_min=sum(check)
    ans_max=ans_min+n-i
print(ans_min,ans_max)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
check=[0]*8
while i<n and a[i]<3200:
    a_i=a[i]
    for j in range(8):
        if check[j]==0 and a_i>=400*j and a_i<400*(j+1):
            check[j]=1
            break
    i+=1
if sum(check)==0:
    ans_min=1
    ans_max=n
else:
    ans_min=sum(check)
    ans_max=ans_min+n-i
print(ans_min,ans_max)
Buggy python submission (verdict: Runtime Error):
n=int(input())
print(x*800-(x//15)*200)

Fixed submission:
n=int(input())
print(n*800-(n//15)*200)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
power=1
for i in range(1,n+1):
    power*=i
print(power%(10**9+7))

Fixed submission:
n=int(input())
power=1
for i in range(1,n+1):
    power*=i
    if power>10**9+7:
        power=power%(10**9+7)
print(power%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
ans=(b-a+1)//x
if ((b-a+1)%x)!=0:
    for i in range(a+ans*x,b+1):
        if i%x==0:
            ans+=1
print(ans)

Fixed submission:
a,b,x=map(int,input().split())
a_x=a%x
if a_x==0:
    print(1+(b-a)//x)
else:
    a_new=a-a_x+x
    if a_new>b:
        print(0)
    else:
        print(1+(b-a_new)//x)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

cnt = 0
leng = len(s)
how = 1
for i in reversed(range(4, leng+1)):
    for j in range(how):
        n = s[j:j+i]
        if int(n) % 2019 == 0:
            cnt += 1
    how += 1

print(cnt)


Fixed submission:
S = input()[::-1]
ans = 0
mods = [0] * 2019
mods[0] = 1
current = 0
x = 1
for s in S:
    current = (current + x * int(s)) % 2019
    ans += mods[current % 2019]
    mods[current % 2019] += 1
    x = x * 10 % 2019
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()

cnt = 0
for i in range(len(s)):
    n = s[i]
    for j in range(i+1, len(s)):
        n += s[j]
        if int(n) % 2019 == 0:
            cnt += 1

print(cnt)


Fixed submission:
S = input()[::-1]
ans = 0
mods = [0] * 2019
mods[0] = 1
current = 0
x = 1
for s in S:
    current = (current + x * int(s)) % 2019
    ans += mods[current % 2019]
    mods[current % 2019] += 1
    x = x * 10 % 2019
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()

cnt = 0
for i in range(len(s)):
    for j in range(i+1, len(s) + 1):
        n = s[i:j]
        if int(n) % 2019 == 0:
            cnt += 1

print(cnt)


Fixed submission:
S = input()[::-1]
ans = 0
mods = [0] * 2019
mods[0] = 1
current = 0
x = 1
for s in S:
    current = (current + x * int(s)) % 2019
    ans += mods[current % 2019]
    mods[current % 2019] += 1
    x = x * 10 % 2019
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

k = int(input())
kl = [i for i in range(1, k+1)]


def gcd(*numbers):
    return reduce(math.gcd, numbers)


total = 0
for i in kl:
    for j in kl:
        for k in kl:
            total += gcd(i, j, k)


print(total)


Fixed submission:
import math

k = int(input())
kl = [i for i in range(1, k+1)]


total = 0
dp = {}
for i in kl:
    for j in kl:
        tmp = math.gcd(i, j)
        for k in kl:
            total += math.gcd(tmp, k)


print(total)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

cnt = 0
runrun = [1,2,3,4,5,6,7,8,9,10]

i = 1
judge = True
while judge:
    lnum = list(str(i))
    div = True
    for j in range(len(lnum)):
        if len(lnum) == 1:
            break

        str_num = lnum[j:j+2]
        if str_num in runrun:
            next
        else:
            if len(lnum) > 3:
                div = False
                break

        now = lnum[j]
        nxt = (j+1) % len(lnum)
        if nxt == 0:
            break
        nxt = lnum[nxt]

        sum_num = int(now) - int(nxt)
        if abs(sum_num) > 1:
            div = False
            break

    if div:
        cnt += 1
        if cnt == k:
            print(i)
            judge = False
            exit
        runrun.append(str(i))

    i += 1



Fixed submission:
k = int(input())

lunlun = [1, 2, 3, 4, 5, 6, 7, 8, 9]


def generate_lunlun(x):
    mod = x % 10

    if mod - 1 >= 0:
        yield x*10 + mod-1

    yield x*10 + mod

    if mod + 1 <= 9:
        yield x*10 + mod + 1


p = 0

while len(lunlun) < k:
    for i in generate_lunlun(lunlun[p]):
        lunlun.append(i)

    p += 1

print(lunlun[k-1])
Buggy python submission (verdict: Time Limit Exceeded):
k, n = map(int, input().split())
house = list(map(int, input().split()))
load = [0]*k

for i in house:
    load[i] = 1


def check(lst):
    return k - lst.index(1) -1


best_way = k
for i in house:
    right = load[i+1:]
    left = load[:i]
    a_way = right + left
    way = min(check(a_way), check(a_way[::-1]))
    if way < best_way:
        best_way = way

print(best_way)


Fixed submission:
k, n = map(int, input().split())
a = list(map(int, input().split()))
 
max_dist = 0
for i in range(n):
    nxt = (i+1) % n
    distance = a[nxt] - a[i]
    if distance < 0:
        distance += k
    max_dist = max(max_dist, distance)
 
print(k-max_dist)

Buggy python submission (verdict: Time Limit Exceeded):
k, n = map(int, input().split())
house = list(map(int, input().split()))
load = [0]*k

for i in house:
    load[i] = 1

def check(lst):
    cnt = 0
    way = 0
    for i in lst:
        way += 1
        if i == 1:
            cnt += 1
        if cnt == n-1:
            break

    return way


best_way = k
for i in house:
    right = load[i+1:]
    left = load[:i]
    right_way = right + left
    left_way = left[::-1] + right[::-1]
    way = min(check(right_way), check(left_way))
    if way < best_way:
        best_way = way

print(best_way)


Fixed submission:
k, n = map(int, input().split())
a = list(map(int, input().split()))
 
max_dist = 0
for i in range(n):
    nxt = (i+1) % n
    distance = a[nxt] - a[i]
    if distance < 0:
        distance += k
    max_dist = max(max_dist, distance)
 
print(k-max_dist)

Buggy python submission (verdict: Time Limit Exceeded):
k, n = map(int, input().split())
house = list(map(int, input().split()))
load = [0]*k

for i in house:
    load[i] = 1

def check(lst):
    cnt = 0
    way = 0
    for i in lst:
        way += 1
        if i == 1:
            cnt += 1
        if cnt == n-1:
            break

    return way


best_way = k
for i in house:
    right = load[i+1:]
    left = load[:i]
    right_way = right + left
    left_way = left[::-1] + right[::-1]
    way = min(check(right_way), check(left_way))
    if way < best_way:
        best_way = way

print(best_way)


Fixed submission:
k, n = map(int, input().split())
a = list(map(int, input().split()))
 
max_dist = 0
for i in range(n):
    nxt = (i+1) % n
    distance = a[nxt] - a[i]
    if distance < 0:
        distance += k
    max_dist = max(max_dist, distance)
 
print(k-max_dist)
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split(' '))

if a == 0:
    print(0)
elif b == 0:
    print(n)
else:
    blue = (n // (a + b)) * a
    amari = n % (a+b)
    if amari > a:
        blue += a
    else:
        blue += amari

    print(blue)


Fixed submission:
a = input()
if len(set(a)) > 1:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
60 88 34
92 41 43
65 73 48
10
60
43
88
11
48
73
65
41
92
34

Fixed submission:
row1 = input().split()
row2 = input().split()
row3 = input().split()

n = int(input())
nums = [input() for i in range(n)]

rows = [row1, row2, row3]

for i in range(0, 3):
    rows += [[row1[i], row2[i], row3[i]]]

rows += [[row1[0], row2[1], row3[2]]]
rows += [[row1[2], row2[1], row3[0]]]

for row in rows:
    j = 0
    for num in nums:
        if num in row:
            j += 1
        if j == 3:
            print('Yes')
            exit()

print('No')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
q = [list(map(int, input().split())) for _ in range(m)]

ans = [0]*n
judge = [0]*n

for i in range(m):
    a_list = q[i]
    rank = a_list[0] - 1
    num = a_list[1]

    if judge[rank] == 0:
        judge[rank] = 1
    else:
        if ans[rank] == num:
            continue
        else:
            print(-1)
            exit()

    ans[rank] = num

for_p = ['0']*m
for i in range(m):
    if judge[i] == 1:
        for_p[i] = str(ans[i])

if for_p[0] == '0':
    print(-1)
else:
    print(int(''.join(for_p)))


Fixed submission:
n, m = map(int, input().split())
q = [list(map(int, input().split())) for _ in range(m)]

ans = ['0']*n
judge = [0]*n

for i in range(m):
    a_list = q[i]
    rank = a_list[0] - 1
    num = str(a_list[1])

    if judge[rank] == 0:
        judge[rank] = 1
        ans[rank] = num
    else:
        if ans[rank] == num:
            continue
        else:
            print(-1)
            exit()


if ans[0] == '0' and judge[0] == 1 and n != 1:
    print(-1)
elif ans[0] == '0' and n != 1:
    ans[0] = '1'
    print(int(''.join(ans)))
else:
    print(int(''.join(ans)))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
q = [list(map(int, input().split())) for _ in range(m)]

ans = [0]*n
judge = [0]*n

for i in range(m):
    a_list = q[i]
    rank = a_list[0] - 1
    num = a_list[1]

    if judge[rank] == 0:
        judge[rank] = 1
    else:
        if ans[rank] == num:
            continue
        else:
            print(-1)
            exit()

    ans[rank] = num

for_p = ['0']*m
for i in range(m):
    if judge[i] == 1:
        for_p[i] = str(ans[i])

if for_p[0] == '0':
    print(-1)
else:
    print(int(''.join(for_p)))


Fixed submission:
n, m = map(int, input().split())
q = [list(map(int, input().split())) for _ in range(m)]

ans = ['0']*n
judge = [0]*n

for i in range(m):
    a_list = q[i]
    rank = a_list[0] - 1
    num = str(a_list[1])

    if judge[rank] == 0:
        judge[rank] = 1
        ans[rank] = num
    else:
        if ans[rank] == num:
            continue
        else:
            print(-1)
            exit()


if ans[0] == '0' and judge[0] == 1 and n != 1:
    print(-1)
elif ans[0] == '0' and n != 1:
    ans[0] = '1'
    print(int(''.join(ans)))
else:
    print(int(''.join(ans)))