Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
ans=0
for i in range(n-k+1):
    num=sum(p[i:i+k])
    if ans<num:
        ans=num
print((ans+k)/2)


Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
num=[sum(p[0:k])]
def ap(num1):
    num.append(num1)
for i in range(n-k):
    ap(num[i]-p[i]+p[k+i])
print((max(num)+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
ans=[]
def ap2(num2):
    ans.append(num2)
for i in range(n-k+1):
    ap2(sum(p[i:i+k]))
print((max(ans)+k)/2)


Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
num=[sum(p[0:k])]
def ap(num1):
    num.append(num1)
for i in range(n-k):
    ap(num[i]-p[i]+p[k+i])
print((max(num)+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
num=[]
def ap(num1):
    num.append(num1)
for i in range(n):
    ap((p[i]+1)/2)
ans=[]
if k==1:
    print(max(num))
else:
    def ap2(num2):
        ans.append(num2)
    for i in range(n-k+1):
        ap2(sum(num[i:i+k]))
    print(max(ans))


Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
num=[sum(p[0:k])]
def ap(num1):
    num.append(num1)
for i in range(n-k):
    ap(num[i]-p[i]+p[k+i])
print((max(num)+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
num=[]
def ap(num1):
    num.append(num1)
for i in range(n):
    ap((p[i]+1)/2)
ans=[]
def ap2(num2):
    ans.append(num2)
for i in range(n-k+1):
    ap2(sum(num[i:i+k]))
print(max(ans))


Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
num=[sum(p[0:k])]
def ap(num1):
    num.append(num1)
for i in range(n-k):
    ap(num[i]-p[i]+p[k+i])
print((max(num)+k)/2)
Buggy python submission (verdict: Runtime Error):
n,d,a=map(int,input().split())
num=[]
for i in range(n):
    num.append(list(map(int,input().split())))
num.sort(key=lambda x: x[0])
cnt=0
cnt2=0
num2=num[0][0]+d
ans=0
for i in range(n):
    yn=0
    for j in range(cnt,n):
        if num2+d<num[j][0]:
            cnt2=j-1
            yn=1
            break
    if yn==0:
        cnt2=n-1
    else:
        yn=0
    num3=-(num[cnt][1]//-a)
    ans+=num3
    for j in range(cnt,cnt2+1):
        num[j][1]-=a*num3
    for j in range(cnt,n):
        if num[j][1]>0:
            yn=1
            cnt=j
            break
    if yn==0 and num[-1][1]>0:
        yn=1
        cnt=n-1
    if yn==0:
        break
    num2=num[cnt][0]+d
print(ans)


Fixed submission:
h,a=map(int,input().split())
b=-(h//-a)
print(b)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
if n<k:
    for i in range(n):
        del h[0]
else:
    for i in range(k):
        del h[0]
print(sum(h))


Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
if n<k:
    del h[0:n]
else:
    del h[0:k]
print(sum(h))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
a=""
for i in range(n):
    a+=s[n-1]
    a+=t[n-1]
print(a)


Fixed submission:
n=int(input())
u=list(input().split())
s=list(u[0])
t=list(u[1])
a=""
for i in range(n):
    a+=s[i]
    a+=t[i]
print(a)
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
c=math.gcd(a,b)
print((a*b)//c)


Fixed submission:
import fractions
a,b=map(int,input().split())
c=fractions.gcd(a,b)
print((a*b)//c)

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


Fixed submission:
import fractions
a,b=map(int,input().split())
c=fractions.gcd(a,b)
print((a*b)//c)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=0
count=0
if a.count(1)==0:
    print(-1)
else:
    for i in range(n):
        if count+1 == a[count]:
            count+=1
        else:
            del a[count]
            ans+=1
    print(ans)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
count=0
if a.count(1)==0:
    print(-1)
else:
    for i in range(n):
        if count+1 != a[i]:
            ans+=1
        else:
            count+=1
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
num=[0]*63
for i in range(n):
    num1=a[i]
    for j in range(63):
        if num1==0:
            break
        if num1%2==1:
            num[j]+=1
        num1//=2
ans=0
for i in range(63):
    if num[i]!=0 and num[i]!=n:
        ans+=((2**i)*num[i]*(n-num[i]))%(10**9+7)
ans%=10**9+7
print(ans)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
num=[0]*63
for i in range(n):
    num1=a[i]
    for j in range(63):
        if num1==0:
            break
        if num1%2==1:
            num[j]+=1
        num1//=2
ans=0
for i in range(63):
    if num[i]!=0 and num[i]!=n:
        ans+=((2**i)*num[i]*(n-num[i]))%(10**9+7)
ans%=10**9+7
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n-2):
    for j in range(i+1,n-1):
        num=l[i]+l[j]
        for k in range(j+1,n):
            if num<=l[k]:
                break
            else:
                ans+=1
print(ans)


Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.sort()
num=[0]*(max(l)+2)
for i in range(n):
    num[l[i]]=i
for i in range(1,len(num)):
    if num[i]==0:
        num[i]=num[i-1]
ans=0
num3=l[n-1]
for i in range(n-2):
    for j in range(i+1,n-1):
        ans+=max(0,num[min(num3,l[i]+l[j]-1)]-j)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n-2):
    for j in range(i+1,n-1):
        num=l[i]+l[j]
        for k in range(j+1,n):
            if num<=l[k]:
                break
            else:
                ans+=1
print(ans)


Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.sort()
num=[0]*(max(l)+2)
for i in range(n):
    num[l[i]]=i
for i in range(1,len(num)):
    if num[i]==0:
        num[i]=num[i-1]
ans=0
num3=l[n-1]
for i in range(n-2):
    for j in range(i+1,n-1):
        ans+=max(0,num[min(num3,l[i]+l[j]-1)]-j)
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(int,input().split())
ans=n
for i in h:
    if i<k:
        ans-=1
print(ans)


Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
ans=n
for i in h:
    if i<k:
        ans-=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(m):
    num=max(a)
    a.remove(num)
    a.append(num//2)
print(sum(a))


Fixed submission:
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=list(map(lambda x: x*(-1), a))
heapq.heapify(a)
for i in range(m):
    heapq.heappush(a, -1*(-heapq.heappop(a)//2))
print(sum(a)*-1)
Buggy python submission (verdict: Runtime Error):
def solve():
    n=int(input())
    num=[]
    def append(num1):
        num.append(num1)
    def count1(num2):
        return num.count(num2)
    for i in range(n):
        a=int(input())
        append(a)
    max1=max(num)
    count=count1(max1)
    if count>1:
        for i in range(n):
            print(max1)
    else:
        for i in range(n):
            if num[i]==max1:
                if i==0:
                    print(max(num[1:]))
                elif i==n-1:
                    print(max(num[:n-1]))
                else:
                    print(max(max(num[:i]),max(num[i+1:])))
            else:
                print(max1)
solve()


Fixed submission:
r=int(input())
print(3*r*r)

Buggy python submission (verdict: Runtime Error):
def solve():
    n=int(input())
    a=[int(input()) for _ in range(n)]
    num1=max(a)
    count=0
    while count!=n:
        if a[count]==num1:
            if count==0:
                print(max(a[1:]))
            elif count==n-1:
                print(max(a[:n-1]))
            else:
                print(max(max(a[:count]),max(a[count+1:])))
        else:
            print(num1)
        count+=1
solve()


Fixed submission:
r=int(input())
print(3*r*r)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
num1=(b//c)-(-1*(a//-c))+1
num2=(b//d)-(-1*(a//-d))+1
num=c*d//(math.gcd(c,d))
num3=(b//num)-(-1*(a//-num))+1
print(b-a+1-num1-num2+num3)


Fixed submission:
import fractions
a,b,c,d=map(int,input().split())
num1=(b//c)-(-1*(a//-c))+1
num2=(b//d)-(-1*(a//-d))+1
num=c*d//(fractions.gcd(c,d))
num3=(b//num)-(-1*(a//-num))+1
print(b-a+1-num1-num2+num3)
Buggy python submission (verdict: Runtime Error):
s=input()
if s.count("o")<:7
    print("NO")
else:
    print("YES")


Fixed submission:
s=input()
if s.count("o")<8-(15-len(s)):
    print("NO")
else:
    print("YES")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[]
r=[]
for i in range(m):
    strl,strr=map(int,input().split())
    l.append(strl)
    r.append(strr)
num1=max(l)
num2=min(r)
if num1>num2:
    print(0)
else:
    print(num2-num1+1)


Fixed submission:
a,b=map(int,input().split())
if a<6:
    print(0)
elif a<13:
    print(b//2)
else:
    print(b)
Buggy python submission (verdict: Runtime Error):
import decimal
n,k=map(int,input().split())
num=[]
num2=[]
num4=0
num5=n
if n>=k:
    num4=decimal.Decimal((n-k+1)/n)
    n=k-1
num6=-1*(k//(-1*n))
for i in range(18):
    num.append(2**i)
for i in range(18):
    if num6<=num[i+1]:
        num6=i
        break
for i in range(18):
    if num[i]>=n:
        num2.append(n-num[i-1])
        break
    else:
        if i==0:
            num2.append(1)
        else:
            num2.append(num[i]-num[i-1])
ans=0
num3=len(num2)
for i in range(len(num2)):
    ans+=num2[i]*(2**(i))
print((decimal.Decimal(decimal.Decimal(ans/num5)/(2**(num3+num6))))+num4)


Fixed submission:
import decimal
n,k=map(int,input().split())
num1=1
num2=0
for i in range(20):
    if num1>=k:
        break
    num1*=2
    num2+=1
num=n*(2**num2)
num1=num2
num3=0
for i in range(1,n+1):
    if i*(2**(num2-1))>=k:
        num2-=1
    if i>=k:
        num3+=2**num1
    else:
        num3+=2**(num1-num2)
print(decimal.Decimal(num3/num))

Buggy python submission (verdict: Runtime Error):
import decimal
n,k=map(int,input().split())
num=[]
num2=[]
num4=0
num5=n
if n>=k:
    num4=decimal.Decimal((n-k+1)/n)
    n=k-1
num6=-1*(k//(-1*n))
for i in range(18):
    num.append(2**i)
for i in range(17):
    if num6<=num[i+1]:
        num6=i
        break
for i in range(17):
    if num[i]>=n:
        num2.append(n-num[i-1])
        break
    else:
        if i==0:
            num2.append(1)
        else:
            num2.append(num[i]-num[i-1])
ans=0
num3=len(num2)
for i in range(len(num2)):
    ans+=num2[i]*(2**(i))
print((decimal.Decimal(decimal.Decimal(ans/num5)/(2**(num3+num6))))+num4)


Fixed submission:
import decimal
n,k=map(int,input().split())
num1=1
num2=0
for i in range(20):
    if num1>=k:
        break
    num1*=2
    num2+=1
num=n*(2**num2)
num1=num2
num3=0
for i in range(1,n+1):
    if i*(2**(num2-1))>=k:
        num2-=1
    if i>=k:
        num3+=2**num1
    else:
        num3+=2**(num1-num2)
print(decimal.Decimal(num3/num))
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
ans=0
for i in range(int(n/r)+1):
    for j in range(int((n-(i*r))/g)+1):
        num=(n-(i*r+j*g))%b
        if num==0 and n-(i*r+j*g)>=0:
            ans+=1
print(ans)


Fixed submission:
def solve():
    r,g,b,n=map(int,input().split())
    ans=0
    for i in range(int(n/r)+1):
        for j in range(int((n-(i*r))/g)+1):
            num=n-(i*r+j*g)
            if num%b==0 and num>=0:
                ans+=1
    print(ans)
solve()

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
ans=0
for i in range(int(n/r)+2):
    for j in range(int(n/g)+2):
        num=(n-(i*r+j*g))%b
        if num==0 and n-(i*r+j*g)>=0:
            ans+=1
print(ans)


Fixed submission:
def solve():
    r,g,b,n=map(int,input().split())
    ans=0
    for i in range(int(n/r)+1):
        for j in range(int((n-(i*r))/g)+1):
            num=n-(i*r+j*g)
            if num%b==0 and num>=0:
                ans+=1
    print(ans)
solve()
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=0
b=0
ab=0
num=0
for i in range(n):
    s=input()
    if s[0]=="B" and s[-1]=="A":
        ab+=1
    elif s[0]=="B":
        b+=1
    elif s[-1]=="A":
        a+=1
    for j in range(len(s)-1):
        if s[i]=="A" and s[i+1]=="B":
            num+=1
if a!=0 and b!=0:
    num+=ab+1
    a-=1
    b-=1
    num+=min(a,b)
elif a!=0:
    num+=ab
elif b!=0:
    num+=ab
else:
    num+=ab-1
print(num)


Fixed submission:
n=int(input())
a=0
b=0
ab=0
num=0
for i in range(n):
    s=input()
    if s[0]=="B" and s[-1]=="A":
        ab+=1
    elif s[0]=="B":
        b+=1
    elif s[-1]=="A":
        a+=1
    for j in range(len(s)-1):
        if s[j]=="A" and s[j+1]=="B":
            num+=1
if a!=0 and b!=0:
    num+=ab+1
    a-=1
    b-=1
    num+=min(a,b)
elif a!=0:
    num+=ab
elif b!=0:
    num+=ab
else:
    num+=max(0,ab-1)
print(num)
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
num=[0]*n
for i in range(n-1):
    if s[i+1]=="C" and s[i]=="A":
        num[i]+=1
def rtn(num1,num2):
    return sum(num[num1:num2])
for i in range(q):
    l,r=map(int,input().split())
    print(rtn(l-1,r-1))


Fixed submission:
n,q=map(int,input().split())
s=input()
num=[0]
for i in range(n-1):
    if s[i+1]=="C" and s[i]=="A":
        num.append(num[-1]+1)
    else:
        num.append(num[-1])
for i in range(q):
    l,r=map(int,input().split())
    print(num[r-1]-num[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
num=[0]*n
for i in range(n-1):
    if s[i+1]=="C" and s[i]=="A":
        num[i]+=1
def rtn(num1,num2):
    return sum(num[num1:num2])
for i in range(q):
    l,r=map(int,input().split())
    print(rtn(l-1,r-1))


Fixed submission:
n,q=map(int,input().split())
s=input()
num=[0]
for i in range(n-1):
    if s[i+1]=="C" and s[i]=="A":
        num.append(num[-1]+1)
    else:
        num.append(num[-1])
for i in range(q):
    l,r=map(int,input().split())
    print(num[r-1]-num[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
num=[0]*n
for i in range(n-1):
    if s[i+1]=="C" and s[i]=="A":
        num[i]+=1
for i in range(q):
    l,r=map(int,input().split())
    print(sum(num[l-1:r-1]))


Fixed submission:
n,q=map(int,input().split())
s=input()
num=[0]
for i in range(n-1):
    if s[i+1]=="C" and s[i]=="A":
        num.append(num[-1]+1)
    else:
        num.append(num[-1])
for i in range(q):
    l,r=map(int,input().split())
    print(num[r-1]-num[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
def c1(num1,num2):
    return s[num1-1:num2].count("AC")
for i in range(q):
    l,r=map(int,input().split())
    print(c1(l,r))


Fixed submission:
n,q=map(int,input().split())
s=input()
num=[0]
for i in range(n-1):
    if s[i+1]=="C" and s[i]=="A":
        num.append(num[-1]+1)
    else:
        num.append(num[-1])
for i in range(q):
    l,r=map(int,input().split())
    print(num[r-1]-num[l-1])
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=[0]*m
ansnum=0
for i in range(n):
    list1=list(map(int,input().split()))
    for j in range(len(list1)-1):
        ans[list1[j]]+=1
for i in range(m):
    if ans[i]==n:
        ansnum+=1
print(ansnum)


Fixed submission:
n,m=map(int,input().split())
ans=[0]*m
ansnum=0
for i in range(n):
    list1=list(map(int,input().split()))
    for j in range(list1[0]):
        ans[list1[j+1]-1]+=1
for i in range(m):
    if ans[i]==n:
        ansnum+=1
print(ansnum)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[0]*n
for i in range(1,n):
    cnt=[]
    for j in range(max(0,i-k),i):
        cnt.append(dp[j]+abs(h[j]-h[i]))
    dp[i]=min(cnt)
print(dp[-1])


Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[0]*n
for i in range(1,n):
    cnt=[]
    for j in range(max(0,i-k),i):
        cnt.append(dp[j]+abs(h[j]-h[i]))
    dp[i]=min(cnt)
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
n,W=map(int,input().split())
dp=[[0]*(W+1) for _ in range(n+1)]
for i in range(1,n+1):
    w,v=map(int,input().split())
    for j in range(w):
        dp[i][j]=dp[i-1][j]
    for j in range(W-w+1):
        dp[i][j+w]=max(dp[i-1][j+w],dp[i-1][j]+v)
print(max(dp[-1]))


Fixed submission:
n,W=map(int,input().split())
dp=[[0]*(W+1) for _ in range(n+1)]
for i in range(1,n+1):
    w,v=map(int,input().split())
    for j in range(w):
        dp[i][j]=dp[i-1][j]
    for j in range(W-w+1):
        dp[i][j+w]=max(dp[i-1][j+w],dp[i-1][j]+v)
print(max(dp[-1]))
Buggy python submission (verdict: Runtime Error):
import math
n,m=map(int,input().split())
s=list(input())
t=list(input())
num=(n*m)//math.gcd(n,m)
str1=["A"]*num
ans=num
numn=num//n
numm=num//m
for i in range(n):
    str1[i*(numn)]=s[i]
for i in range(m):
    str2=str1[i*numm]
    if str2!="A" and str2!=t[i]:
        ans=-1
        break
print(ans)


Fixed submission:
import math
n,m=map(int,input().split())
s=list(input())
t=list(input())
num=math.gcd(n,m)
ans=(n*m)//num
numn=n//num
numm=m//num
for i in range(num):
    if s[i*numn]!=t[i*numm]:
        ans=-1
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n,m=map(int,input().split())
s=list(input())
t=list(input())
num=(n*m)//math.gcd(n,m)
str1=[0]*num
ans=num
numn=num//n
numm=num//m
for i in range(n):
    str1[i*(numn)]=s[i]
for i in range(m):
    str2=str1[i*numm]
    if str2!=0 and str2!=t[i]:
        ans=-1
        break
print(ans)


Fixed submission:
import math
n,m=map(int,input().split())
s=list(input())
t=list(input())
num=math.gcd(n,m)
ans=(n*m)//num
numn=n//num
numm=m//num
for i in range(num):
    if s[i*numn]!=t[i*numm]:
        ans=-1
        break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
v=list(input().split())
list1=[]
list2=[]
for i in range(n):
    if i%2==0:
        list1.append(v[i])
    else:
        list2.append(v[i])
num1=set()
num2=set()
max1=[]
max2=[]
for i in range(n):
    if i%2==0:
        num1.add(v[i])
    else:
        num2.add(v[i])
for i in range(len(num1)):
    str1=num1.pop()
    max1.append([str1,list1.count(str1)])
for i in range(len(num2)):
    str2=num2.pop()
    max2.append([str2,list2.count(str2)])
stra= lambda val: val[1]
max1.sort(key=stra,reverse=True)
max2.sort(key=stra,reverse=True)
if max1[0][0]==max2[0][0]:
    if len(max1)==1 and len(max2)==1:
        numa=max1[0][1]
        numb=0
    elif len(max1)==1:
        numa=max1[0][1]
        numb=max2[1][1]
    elif len(max2)==1:
        numa=max1[1][1]
        numb=max2[0][1]
    elif max1[1][1]>max2[1][1]:
        numa=max1[1][1]
        numb=max2[0][1]
    else:
        numa=max1[0][1]
        numb=max2[1][1]
else:
    numa=max1[0][1]
    numb=max2[0][1]
print(n-(numa+numb))


Fixed submission:
n=int(input())
v=list(map(int,input().split()))
numg=[]
numk=[]
for i in range(n):
    if i%2==0:
        numk.append(v[i])
    else:
        numg.append(v[i])
numk.sort()
numg.sort()
numk2=[]
numg2=[]
num1=0
cnt=0
for i in range(len(numk)):
    if num1!=numk[i]:
        numk2.append([num1,cnt])
        num1=numk[i]
        cnt=1
    else:
        cnt+=1
numk2.append([num1,cnt])
num1=0
cnt=0
for i in range(len(numg)):
    if num1!=numg[i]:
        numg2.append([num1,cnt])
        num1=numg[i]
        cnt=1
    else:
        cnt+=1
numg2.append([num1,cnt])
str1= lambda val: val[1]
numg2.sort(key=str1)
numk2.sort(key=str1)
if numg2[-1][0]==numk2[-1][0]:
    print(n-max(numg2[-1][1]+numk2[-2][1],numg2[-2][1]+numk2[-1][1]))
else:
    print(n-(numg2[-1][1]+numk2[-1][1]))
Buggy python submission (verdict: Runtime Error):
a,b=int(input())
if a+b==15:
    print("+")
elif a*b==15:
    print("*")
else:
    print("x")


Fixed submission:
a,b=map(int,input().split())
if a+b==15:
    print("+")
elif a*b==15:
    print("*")
else:
    print("x")
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
e=s.count("E")
w=n-e
ans=e
nume=0
numw=0
for i in range(n):
    if s[i]=="E":
        nume+=1
    else:
        numw+=1
    ans=min(ans,numw+e-nume)
print(ans)


Fixed submission:
a,b=map(int,input().split())
c=a+b
d=a-b
e=a*b
print(max(c,d,e))
Buggy python submission (verdict: Time Limit Exceeded):
s=list(input())
k1=int(input())
l1=set()
for i in range(len(s)):
    l1.add(s[i])
a1=[]
for i in range(len(l1)):
    a1.append(l1.pop())
a1.sort()
for i in range(len(a1)):
    str=a1[i]
    l2=set()
    for j in range(len(s)):
        if s[j]==str:
            l2.add(s[j])
            str2=s[j]
            for k in range(j+1,len(s)):
                str2+=s[k]
                l2.add(str2)
    if len(l2)>=k1:
        l3=sorted(l2)
        ans=l3[k1-1]
        break
    else:
        k1-=len(l2)
print(ans)


Fixed submission:
s=list(input())
k1=int(input())
l1=set()
for i in range(len(s)):
    l1.add(s[i])
a1=[]
for i in range(len(l1)):
    a1.append(l1.pop())
a1.sort()
for i in range(len(a1)):
    str=a1[i]
    l2=set()
    for j in range(len(s)):
        if s[j]==str:
            l2.add(s[j])
            str2=s[j]
            for k in range(j+1,min(len(s),j+7)):
                str2+=s[k]
                l2.add(str2)
    if len(l2)>=k1:
        l3=sorted(l2)
        ans=l3[k1-1]
        break
    else:
        k1-=len(l2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s=list(input())
k1=int(input())
l1=set()
for i in range(len(s)):
    l1.add(s[i])
a1=[]
for i in range(len(l1)):
    a1.append(l1.pop())
a1.sort()
for i in range(len(a1)):
    str=a1[i]
    l2=set()
    for j in range(len(s)):
        if s[j]==str:
            l2.add(s[j])
            str2=s[j]
            for k in range(j+1,len(s)):
                str2+=s[k]
                l2.add(str2)
    if len(l2)>=k1:
        l3=sorted(l2)
        ans=l3[k1-1]
        break
    else:
        k1-=len(l2)
print(ans)


Fixed submission:
s=list(input())
k1=int(input())
l1=set()
for i in range(len(s)):
    l1.add(s[i])
a1=[]
for i in range(len(l1)):
    a1.append(l1.pop())
a1.sort()
for i in range(len(a1)):
    str=a1[i]
    l2=set()
    for j in range(len(s)):
        if s[j]==str:
            l2.add(s[j])
            str2=s[j]
            for k in range(j+1,min(len(s),j+7)):
                str2+=s[k]
                l2.add(str2)
    if len(l2)>=k1:
        l3=sorted(l2)
        ans=l3[k1-1]
        break
    else:
        k1-=len(l2)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
k=int(input())
print((max(a,b,c)*(2**k))+(a+b+c)-max(a,b,c)


Fixed submission:
a,b,c=map(int,input().split())
k=int(input())
print((max(a,b,c)*(2**k))+(a+b+c)-max(a,b,c))
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=[int(input) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m))))


Fixed submission:
n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m))))

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=[int(input) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m)))


Fixed submission:
n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m))))

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=[int(input) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//min(m)))


Fixed submission:
n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m))))